From cea10dda761e1f1b05362c5fe8db28e9bf0469e3 Mon Sep 17 00:00:00 2001 From: Andres Taylor Date: Thu, 10 May 2018 16:55:18 +0200 Subject: [PATCH] Remove the front end We are moving the front end out from Neo4j and to the openCypher namespace and repository. --- community/bolt/LICENSES.txt | 6 + community/bolt/NOTICE.txt | 6 + .../cypher-logical-plans-3.5/LICENSES.txt | 6 + .../cypher-logical-plans-3.5/NOTICE.txt | 6 + .../cypher/cypher-logical-plans-3.5/pom.xml | 20 +- .../v3_5/logical/plans/ActiveRead.scala | 2 +- .../v3_5/logical/plans/Aggregation.scala | 4 +- .../v3_5/logical/plans/AllNodesScan.scala | 2 +- .../logical/plans/AntiConditionalApply.scala | 2 +- .../internal/v3_5/logical/plans/Apply.scala | 2 +- .../v3_5/logical/plans/Argument.scala | 2 +- .../v3_5/logical/plans/AssertSameNode.scala | 2 +- .../v3_5/logical/plans/CartesianProduct.scala | 2 +- .../v3_5/logical/plans/ConditionalApply.scala | 2 +- .../v3_5/logical/plans/CreateNode.scala | 4 +- .../logical/plans/CreateRelationship.scala | 4 +- .../v3_5/logical/plans/DeleteExpression.scala | 4 +- .../v3_5/logical/plans/DeleteNode.scala | 4 +- .../v3_5/logical/plans/DeletePath.scala | 4 +- .../logical/plans/DeleteRelationship.scala | 4 +- .../plans/DetachDeleteExpression.scala | 4 +- .../v3_5/logical/plans/DetachDeleteNode.scala | 4 +- .../v3_5/logical/plans/DetachDeletePath.scala | 4 +- .../plans/DirectedRelationshipByIdSeek.scala | 2 +- .../v3_5/logical/plans/Distinct.scala | 4 +- .../v3_5/logical/plans/DropResult.scala | 2 +- .../internal/v3_5/logical/plans/Eager.scala | 2 +- .../v3_5/logical/plans/EmptyResult.scala | 2 +- .../v3_5/logical/plans/ErrorPlan.scala | 2 +- .../internal/v3_5/logical/plans/Expand.scala | 4 +- .../logical/plans/FindShortestPaths.scala | 4 +- .../v3_5/logical/plans/ForeachApply.scala | 4 +- .../logical/plans/LeftOuterHashJoin.scala | 2 +- .../logical/plans/LetSelectOrSemiApply.scala | 4 +- .../v3_5/logical/plans/LetSemiApply.scala | 2 +- .../internal/v3_5/logical/plans/Limit.scala | 4 +- .../internal/v3_5/logical/plans/LoadCSV.scala | 4 +- .../v3_5/logical/plans/LockNodes.scala | 2 +- .../v3_5/logical/plans/LogicalPlan.scala | 12 +- .../v3_5/logical/plans/MergeCreateNode.scala | 4 +- .../plans/MergeCreateRelationship.scala | 4 +- .../logical/plans/NestedPlanExpression.scala | 10 +- .../v3_5/logical/plans/NodeByIdSeek.scala | 2 +- .../v3_5/logical/plans/NodeByLabelScan.scala | 4 +- .../plans/NodeCountFromCountStore.scala | 4 +- .../v3_5/logical/plans/NodeHashJoin.scala | 2 +- .../logical/plans/NodeIndexContainsScan.scala | 4 +- .../logical/plans/NodeIndexEndsWithScan.scala | 4 +- .../v3_5/logical/plans/NodeIndexScan.scala | 4 +- .../v3_5/logical/plans/NodeIndexSeek.scala | 4 +- .../logical/plans/NodeUniqueIndexSeek.scala | 4 +- .../v3_5/logical/plans/NonSargable.scala | 4 +- .../v3_5/logical/plans/Optional.scala | 2 +- .../logical/plans/ProceduralLogicalPlan.scala | 6 +- .../v3_5/logical/plans/ProcedureCall.scala | 2 +- .../logical/plans/ProcedureSignature.scala | 6 +- .../v3_5/logical/plans/ProduceResult.scala | 2 +- .../v3_5/logical/plans/ProjectEndpoints.scala | 4 +- .../v3_5/logical/plans/Projection.scala | 4 +- .../RelationshipCountFromCountStore.scala | 4 +- .../v3_5/logical/plans/RemoveLabels.scala | 4 +- .../v3_5/logical/plans/ResolvedCall.scala | 15 +- .../plans/ResolvedFunctionInvocation.scala | 16 +- .../logical/plans/RightOuterHashJoin.scala | 2 +- .../v3_5/logical/plans/RollUpApply.scala | 2 +- .../v3_5/logical/plans/SeekRangeWrapper.scala | 10 +- .../v3_5/logical/plans/SeekableArgs.scala | 4 +- .../logical/plans/SelectOrSemiApply.scala | 4 +- .../v3_5/logical/plans/Selection.scala | 4 +- .../v3_5/logical/plans/SemiApply.scala | 2 +- .../v3_5/logical/plans/SetLabels.scala | 4 +- .../plans/SetNodePropertiesFromMap.scala | 4 +- .../v3_5/logical/plans/SetNodeProperty.scala | 4 +- .../v3_5/logical/plans/SetProperty.scala | 4 +- .../SetRelationshipPropertiesFromMap.scala | 4 +- .../plans/SetRelationshipPropery.scala | 4 +- .../internal/v3_5/logical/plans/Skip.scala | 4 +- .../internal/v3_5/logical/plans/Sort.scala | 2 +- .../internal/v3_5/logical/plans/Top.scala | 4 +- .../v3_5/logical/plans/TreeBuilder.scala | 2 +- .../v3_5/logical/plans/TriadicSelection.scala | 2 +- .../UndirectedRelationshipByIdSeek.scala | 2 +- .../internal/v3_5/logical/plans/Union.scala | 2 +- .../v3_5/logical/plans/UnwindCollection.scala | 4 +- .../v3_5/logical/plans/ValueHashJoin.scala | 4 +- .../internal/v3_5/logical/plans/package.scala | 2 +- .../v3_5/logical/plans/LogicalPlansTest.scala | 8 +- .../v3_5/logical/plans/NullOrderingTest.scala | 2 +- .../cypher/cypher-planner-3.5/LICENSES.txt | 6 + .../cypher/cypher-planner-3.5/NOTICE.txt | 6 + community/cypher/cypher-planner-3.5/pom.xml | 38 +- .../v3_5/common/CypherOrderability.java | 6 +- .../compiler/v3_5/ContextCreator.scala | 7 +- .../compiler/v3_5/CypherCompiler.scala | 8 +- .../compiler/v3_5/CypherCompilerFactory.scala | 6 +- ...cedureCallOrSchemaCommandPlanBuilder.scala | 12 +- .../v3_5/SyntaxExceptionCreator.scala | 4 +- .../compiler/v3_5/ast/QueryTagger.scala | 10 +- ...containsNamedPathOnlyForShortestPath.scala | 6 +- .../plannerQuery/ClauseConverters.scala | 8 +- .../plannerQuery/PlannerQueryBuilder.scala | 10 +- .../plannerQuery/StatementConverters.scala | 12 +- .../groupInequalityPredicates.scala | 4 +- .../v3_5/ast/rewriters/InliningContext.scala | 6 +- .../ast/rewriters/inlineProjections.scala | 8 +- .../rewriters/inliningContextCreator.scala | 4 +- .../namePatternPredicatePatternElements.scala | 6 +- .../reattachAliasedExpressions.scala | 6 +- .../compiler/v3_5/helpers/Tapper.scala | 36 - .../v3_5/phases/CompilationContains.scala | 6 +- .../v3_5/phases/CompilerContext.scala | 9 +- .../v3_5/phases/CreatePlannerQuery.scala | 9 +- .../v3_5/phases/DeprecationWarnings.scala | 9 +- .../v3_5/phases/LogicalPlanState.scala | 12 +- .../v3_5/phases/RewriteProcedureCalls.scala | 12 +- .../planner/CantCompileQueryException.scala | 4 +- .../planner/CheckForUnresolvedTokens.scala | 9 +- .../compiler/v3_5/planner/ResolveTokens.scala | 12 +- .../compiler/v3_5/planner/Selections.scala | 2 +- .../logical/CardinalityCostModel.scala | 4 +- .../v3_5/planner/logical/Eagerness.scala | 6 +- .../logical/LogicalPlanningContext.scala | 14 +- .../logical/LogicalPlanningFunction.scala | 2 +- .../logical/LogicalPlanningSupport.scala | 2 +- .../v3_5/planner/logical/Metrics.scala | 8 +- .../logical/OptionalMatchRemover.scala | 12 +- .../planner/logical/PlanEventHorizon.scala | 2 +- .../planner/logical/PlanSingleQuery.scala | 2 +- .../v3_5/planner/logical/PlanUpdates.scala | 4 +- .../v3_5/planner/logical/PlanWithTail.scala | 2 +- .../planner/logical/QueryGraphSolver.scala | 6 +- .../v3_5/planner/logical/QueryPlanner.scala | 8 +- .../logical/ReportCostComparisonsAsRows.scala | 8 +- .../StatisticsBackedCardinalityModel.scala | 6 +- .../ExpressionSelectivityCalculator.scala | 6 +- .../cardinality/SelectivityCombiner.scala | 2 +- .../cardinality/SelectivityEstimator.scala | 6 +- .../logical/cardinality/TokenSpec.scala | 2 +- ...dependenceQueryGraphCardinalityModel.scala | 6 +- .../PatternSelectivityCalculator.scala | 6 +- .../planner/logical/debug/DebugPrinter.scala | 13 +- .../logical/idp/SingleComponentPlanner.scala | 4 +- .../idp/cartesianProductsOrValueJoins.scala | 2 +- .../logical/idp/expandSolverStep.scala | 2 +- .../logical/idp/extractPredicates.scala | 4 +- .../logical/patternExpressionRewriter.scala | 9 +- .../v3_5/planner/logical/plans/Sargable.scala | 4 +- .../plans/rewriter/LogicalPlanRewriter.scala | 15 +- .../logical/plans/rewriter/cleanUpEager.scala | 4 +- .../plans/rewriter/fuseSelections.scala | 4 +- .../predicateRemovalThroughJoins.scala | 6 +- .../plans/rewriter/pruningVarExpander.scala | 6 +- .../plans/rewriter/removeIdenticalPlans.scala | 4 +- .../plans/rewriter/simplifyPredicates.scala | 4 +- .../plans/rewriter/simplifySelections.scala | 6 +- .../logical/plans/rewriter/unnestApply.scala | 4 +- .../plans/rewriter/unnestOptional.scala | 8 +- .../logical/plans/rewriter/useTop.scala | 4 +- .../steps/AbstractIndexSeekLeafPlanner.scala | 9 +- .../steps/DynamicPropertyNotifier.scala | 4 +- .../logical/steps/IndexSeekLeafPlanner.scala | 4 +- .../logical/steps/LogicalPlanProducer.scala | 12 +- .../planner/logical/steps/OrLeafPlanner.scala | 6 +- .../steps/PatternExpressionSolver.scala | 8 +- .../logical/steps/countStorePlanner.scala | 6 +- .../logical/steps/getDegreeRewriter.scala | 8 +- .../logical/steps/idSeekLeafPlanner.scala | 4 +- .../logical/steps/indexScanLeafPlanner.scala | 6 +- .../logical/steps/labelScanLeafPlanner.scala | 4 +- .../mergeUniqueIndexSeekLeafPlanner.scala | 4 +- .../logical/steps/planShortestPaths.scala | 9 +- .../planner/logical/steps/projection.scala | 2 +- .../steps/selectHasLabelWithJoin.scala | 2 +- .../steps/selectPatternPredicates.scala | 4 +- .../logical/steps/solveOptionalMatches.scala | 2 +- .../logical/steps/sortSkipAndLimit.scala | 6 +- .../steps/triadicSelectionFinder.scala | 4 +- .../steps/uniqueIndexSeekLeafPlanner.scala | 4 +- .../logical/steps/verifyBestPlan.scala | 7 +- .../compiler/v3_5/prettifier/Prettifier.scala | 4 +- .../v3_5/common/CypherOrderabilityTest.java | 2 +- .../compiler/v3_5/IdentityMapTest.scala | 76 - .../compiler/v3_5/InputPositionTest.scala | 45 - .../v3_5/NotImplementedPlanContext.scala | 2 +- .../v3_5/RewriteProcedureCallsTest.scala | 8 +- .../internal/compiler/v3_5/ScopeTest.scala | 95 -- .../compiler/v3_5/ScopeTreeTest.scala | 235 --- .../v3_5/ScopeTreeVerificationTest.scala | 43 - .../compiler/v3_5/SemanticCheckableTest.scala | 218 --- .../compiler/v3_5/SemanticStateTest.scala | 282 ---- .../compiler/v3_5/ast/CallClauseTest.scala | 10 +- .../compiler/v3_5/ast/QueryTaggerTest.scala | 2 +- .../compiler/v3_5/ast/QueryTagsTest.scala | 2 +- .../AggregationsAreIsolatedTest.scala | 8 +- .../conditions/CollectNodesOfTypeTest.scala | 10 +- ...ainsNamedPathOnlyForShortestPathTest.scala | 6 +- .../ContainsNoMatchingNodesTest.scala | 10 +- .../ContainsNoNodesOfTypeTest.scala | 10 +- .../NoDuplicatesInReturnItemsTest.scala | 8 +- ...oReferenceEqualityAmongVariablesTest.scala | 10 +- .../NoUnnamedPatternElementsInMatchTest.scala | 10 +- .../NormalizedEqualsArgumentsTest.scala | 8 +- .../OrderByOnlyOnVariablesTest.scala | 10 +- ...rnElementsInPatternComprehensionTest.scala | 10 +- .../GroupInequalityPredicatesTest.scala | 8 +- .../MutatingStatementConvertersTest.scala | 6 +- .../PatternExpressionConverterTest.scala | 4 +- .../StatementConvertersTest.scala | 12 +- .../UnionStatementConvertersTest.scala | 4 +- .../AddUniquenessPredicatesTest.scala | 6 +- .../ast/rewriters/CNFNormalizerTest.scala | 9 +- .../rewriters/CollapseInCollectionsTest.scala | 5 +- .../ast/rewriters/DeMorganRewriterTest.scala | 8 +- .../DesugarDesugaredMapProjectionTest.scala | 12 +- .../rewriters/DistributeLawRewriterTest.scala | 10 +- .../ast/rewriters/ExpandCallWhereTest.scala | 6 +- .../v3_5/ast/rewriters/ExpandStarTest.scala | 12 +- .../FlattenBooleanOperatorsTest.scala | 4 +- .../ast/rewriters/FoldConstantsTest.scala | 8 +- .../ast/rewriters/InlineProjectionsTest.scala | 10 +- .../InliningContextCreatorTest.scala | 2 +- .../ast/rewriters/InliningContextTest.scala | 6 +- .../rewriters/IsolateAggregationTest.scala | 8 +- .../rewriters/LiteralReplacementTest.scala | 12 +- .../MatchPredicateNormalizerTest.scala | 12 +- .../NameGraphOfPatternElementTest.scala | 7 +- .../NameMatchPatternElementTest.scala | 6 +- .../v3_5/ast/rewriters/NamespacerTest.scala | 19 +- .../NormalizeArgumentOrderTest.scala | 8 +- .../rewriters/NormalizeComparisonsTest.scala | 8 +- .../rewriters/NormalizeNotEqualsTest.scala | 8 +- .../NormalizeReturnClausesTest.scala | 8 +- .../NormalizeSargablePredicatesTest.scala | 10 +- .../rewriters/NormalizeWithClausesTest.scala | 10 +- .../ast/rewriters/PredicateTestSupport.scala | 6 +- .../ProjectFreshSortExpressionsTest.scala | 10 +- .../ast/rewriters/ProjectNamedPathsTest.scala | 12 +- .../ReattachAliasedExpressionsTest.scala | 4 +- ...eplaceAliasedFunctionInvocationsTest.scala | 8 +- ...aceLiteralDynamicPropertyLookupsTest.scala | 10 +- .../ReturnItemSafeTopDownRewriterTest.scala | 10 +- .../RewriteEqualityToInPredicateTest.scala | 6 +- .../v3_5/ast/rewriters/RewriteTest.scala | 11 +- .../rewriters/SimplifyPredicatesTest.scala | 4 +- .../ast/rewriters/TransitiveClosureTest.scala | 6 +- .../createGraphIntroducesHorizonTest.scala | 6 +- ...amedPathsInPatternComprehensionsTest.scala | 10 +- .../ast/rewriters/mergeInPredicatesTest.scala | 7 +- ...ternComprehensionPatternElementsTest.scala | 10 +- .../normalizeGraphReturnItemsTest.scala | 10 +- .../v3_5/helpers/CachedFunctionTest.scala | 2 +- .../v3_5/helpers/LazyIterableTest.scala | 2 +- .../v3_5/helpers/ScopeTestHelper.scala | 61 - .../v3_5/helpers/SemanticTableHelper.scala | 33 - .../v3_5/helpers/TreeZipperTest.scala | 198 --- .../compiler/v3_5/parser/ParserFixture.scala | 30 - .../v3_5/parser/PeriodicCommitHintTest.scala | 8 +- .../AssertionsShouldBeEnabledTest.scala | 4 +- .../StatsDivergenceCalculatorTest.scala | 2 +- .../planner/AstRewritingTestSupport.scala | 11 +- .../CheckForUnresolvedTokensTest.scala | 11 +- .../planner/DbStructureGraphStatistics.scala | 4 +- ...tructureLogicalPlanningConfiguration.scala | 4 +- .../planner/HardcodedGraphStatistics.scala | 2 +- .../LogicalPlanningConfiguration.scala | 4 +- .../planner/LogicalPlanningTestSupport.scala | 24 +- .../planner/LogicalPlanningTestSupport2.scala | 27 +- .../v3_5/planner/PlannerQueryTest.scala | 6 +- .../v3_5/planner/QueryGraphTest.scala | 4 +- .../RealLogicalPlanningConfiguration.scala | 4 +- .../v3_5/planner/ResolveTokensTest.scala | 14 +- .../v3_5/planner/SelectionsTest.scala | 6 +- .../v3_5/planner/SemanticTableBuilder.scala | 6 +- .../v3_5/planner/SemanticTableTest.scala | 12 +- .../StubbedLogicalPlanningConfiguration.scala | 6 +- .../v3_5/planner/UpdateGraphTest.scala | 6 +- .../ArgumentPlanningIntegrationTest.scala | 4 +- .../BenchmarkCardinalityEstimationTest.scala | 2 +- .../logical/CardinalityCostModelTest.scala | 6 +- .../planner/logical/CardinalitySupport.scala | 2 +- ...tesianProductPlanningIntegrationTest.scala | 2 +- .../CreateNodePlanningIntegrationTest.scala | 4 +- ...eRelationshipPlanningIntegrationTest.scala | 4 +- .../logical/DefaultQueryPlannerTest.scala | 16 +- .../ExpandPlanningIntegrationTest.scala | 6 +- ...ShortestPathsPlanningIntegrationTest.scala | 4 +- .../logical/LeafPlanningIntegrationTest.scala | 12 +- .../MergeNodePlanningIntegrationTest.scala | 4 +- ...eRelationshipPlanningIntegrationTest.scala | 6 +- ...athProjectionPlanningIntegrationTest.scala | 4 +- .../NodeHashJoinPlanningIntegrationTest.scala | 4 +- ...OptionalMatchPlanningIntegrationTest.scala | 8 +- .../logical/OptionalMatchRemoverTest.scala | 16 +- ...ernExpressionPatternElementNamerTest.scala | 8 +- ...ternPredicatePlanningIntegrationTest.scala | 6 +- .../PickBestPlanUsingHintsAndCostTest.scala | 10 +- .../logical/PlanEventHorizonTest.scala | 8 +- ...PlanRewritingPlanningIntegrationTest.scala | 6 +- .../logical/PriorityLeafPlannerListTest.scala | 2 +- .../QueryGraphConnectedComponentsTest.scala | 6 +- .../planner/logical/QueryGraphProducer.scala | 10 +- .../v3_5/planner/logical/SolvablesTest.scala | 4 +- ...StatisticsBackedCardinalityModelTest.scala | 2 +- .../UnionPlanningIntegrationTest.scala | 4 +- .../logical/WithPlanningIntegrationTest.scala | 6 +- .../CardinalityModelTestHelper.scala | 4 +- .../cardinality/CardinalityTestHelper.scala | 23 +- .../ExpressionSelectivityCalculatorTest.scala | 12 +- .../RandomizedCardinalityModelTestSuite.scala | 2 +- .../cardinality/SelectivityCombinerTest.scala | 4 +- .../PatternSelectivityCalculatorTest.scala | 10 +- .../CartesianProductsOrValueJoinsTest.scala | 8 +- .../logical/idp/ExpandSolverStepTest.scala | 16 +- .../logical/idp/IDPQueryGraphSolverTest.scala | 8 +- .../planner/logical/idp/IDPSolverTest.scala | 2 +- .../planner/logical/idp/IDPTableTest.scala | 2 +- .../logical/idp/JoinSolverStepTest.scala | 4 +- .../idp/SingleComponentPlannerTest.scala | 6 +- .../logical/idp/extractPredicatesTest.scala | 6 +- .../patternExpressionRewriterTest.scala | 6 +- .../plans/AllNodesLeafPlannerTest.scala | 4 +- .../plans/ArgumentLeafPlannerTest.scala | 4 +- .../logical/plans/IdSeekLeafPlannerTest.scala | 14 +- .../logical/plans/IndexLeafPlannerTest.scala | 6 +- .../plans/IndexScanLeafPlannerTest.scala | 8 +- .../plans/IndexSeekLeafPlannerTest.scala | 6 +- .../plans/InequalityRangeSeekableTest.scala | 8 +- .../plans/LabelScanLeafPlannerTest.scala | 8 +- .../plans/LogicalPlanAssignedIdTest.scala | 2 +- .../plans/LogicalPlanEqualityTest.scala | 4 +- .../logical/plans/LogicalPlanTest.scala | 2 +- .../planner/logical/plans/SargableTest.scala | 6 +- .../plans/rewriter/FuseSelectionsTest.scala | 4 +- .../PredicateRemovalThroughJoinsTest.scala | 8 +- .../rewriter/PruningVarExpanderTest.scala | 6 +- .../rewriter/SimplifyPredicatesTest.scala | 6 +- .../rewriter/SimplifySelectionsTest.scala | 7 +- .../plans/rewriter/UnnestApplyTest.scala | 8 +- .../plans/rewriter/UnnestOptionalTest.scala | 4 +- .../logical/plans/rewriter/UseTopTest.scala | 7 +- .../plans/rewriter/cleanUpEagerTest.scala | 9 +- .../rewriter/removeIdenticalPlansTest.scala | 4 +- .../logical/steps/AggregationTest.scala | 4 +- .../logical/steps/ExtractBestPlanTest.scala | 11 +- .../logical/steps/LeftOuterHashJoinTest.scala | 8 +- .../logical/steps/OrLeafPlannerTest.scala | 4 +- .../steps/PatternExpressionSolverTest.scala | 8 +- .../logical/steps/ProjectionTest.scala | 10 +- .../steps/RightOuterHashJoinTest.scala | 8 +- .../logical/steps/SelectCoveredTest.scala | 6 +- .../steps/SelectHasLabelWithJoinTest.scala | 2 +- .../steps/SelectPatternPredicatesTest.scala | 8 +- .../logical/steps/SortSkipAndLimitTest.scala | 8 +- .../steps/TriadicSelectionFinderTest.scala | 6 +- .../logical/steps/countStorePlannerTest.scala | 6 +- .../logical/steps/getDegreeRewriterTest.scala | 8 +- .../planner/logical/unnestEagerTest.scala | 8 +- .../prettifier/PrettifierParserTest.scala | 3 +- .../v3_5/prettifier/PrettifierTest.scala | 2 +- .../spi/GraphStatisticsSnapshotTest.scala | 4 +- .../v3_5/test_helpers/ContextHelper.scala | 9 +- community/cypher/cypher/LICENSES.txt | 6 + community/cypher/cypher/NOTICE.txt | 6 + community/cypher/cypher/pom.xml | 29 +- .../codegen/CompiledConversionUtils.java | 4 +- .../internal/codegen/CompiledMathHelper.java | 4 +- .../internal/tracing/CompilationTracer.java | 2 +- .../tracing/TimingCompilationTracer.java | 2 +- .../cypher/internal/CompatibilityCache.scala | 2 +- .../internal/CompilerEngineDelegator.scala | 21 +- .../cypher/internal/CypherPreParser.scala | 4 +- .../cypher/internal/ExecutionEngine.scala | 2 +- .../neo4j/cypher/internal/ParsedQuery.scala | 2 +- .../cypher/internal/PreParsedQuery.scala | 2 +- ...tRuntimeVariablePlannerCompatibility.scala | 2 +- .../compatibility/v2_3/Compatibility.scala | 4 +- .../v2_3/ExecutionResultWrapper.scala | 4 +- .../internal/compatibility/v2_3/helpers.scala | 6 +- .../compatibility/v3_1/Compatibility.scala | 3 +- .../v3_1/ExecutionResultWrapper.scala | 6 +- .../internal/compatibility/v3_1/helpers.scala | 6 +- .../v3_3/ActiveReadInjector.scala | 4 +- .../compatibility/v3_3/Compatibility.scala | 4 +- .../compatibility/v3_3/IdConverter.scala | 2 +- .../v3_3/LogicalPlanConverter.scala | 14 +- .../v3_3/SemanticTableConverter.scala | 18 +- .../compatibility/v3_3/StatementWrapper.scala | 6 +- .../WrappedInstrumentedGraphStatistics.scala | 2 +- .../compatibility/v3_3/exceptionHandler.scala | 2 +- .../internal/compatibility/v3_3/helpers.scala | 18 +- .../CheckForLoadCsvAndMatchOnLargeLabel.scala | 5 +- .../compatibility/v3_5/Compatibility.scala | 10 +- .../ExceptionTranslatingPlanContext.scala | 2 +- .../ExceptionTranslatingQueryContext.scala | 2 +- .../v3_5/LogicalPlanNotifications.scala | 2 +- .../compatibility/v3_5/WrappedMonitors.scala | 2 +- .../v3_5/checkForEagerLoadCsv.scala | 4 +- .../BuildInterpretedExecutionPlan.scala | 8 +- .../runtime/CommunityRuntimeContext.scala | 6 +- .../v3_5/runtime/PipeExecutionResult.scala | 2 +- .../v3_5/runtime/ResultIterator.scala | 2 +- .../v3_5/runtime/RuntimeBuilder.scala | 5 +- ...DefaultExecutionResultBuilderFactory.scala | 6 +- .../runtime/executionplan/ExecutionPlan.scala | 2 +- .../ExecutionResultBuilder.scala | 6 +- .../LoadCsvPeriodicCommitObserver.scala | 2 +- .../StandardInternalExecutionResult.scala | 2 +- .../procs/ProcedureCallExecutionPlan.scala | 8 +- ...lOrSchemaCommandExecutionPlanBuilder.scala | 10 +- .../procs/ProcedureExecutionResult.scala | 4 +- .../procs/PureSideEffectExecutionPlan.scala | 4 +- .../runtime/helpers/InternalWrapping.scala | 3 +- .../helpers/simpleExpressionEvaluator.scala | 4 +- .../v3_5/runtime/profiler/Profiler.scala | 2 +- .../cypher/QueryExecutionMonitorTest.scala | 2 +- .../org/neo4j/cypher/QueryInvalidationIT.java | 2 +- .../org/neo4j/cypher/ErrorMessagesTest.scala | 2 +- .../cypher/ExecutionEngineFunSuite.scala | 2 +- .../org/neo4j/cypher/ExecutionEngineIT.scala | 7 +- .../cypher/ExecutionEngineTestSupport.scala | 2 +- .../JoinHintPlanningIntegrationTest.scala | 4 +- .../scala/org/neo4j/cypher/PatternGen.scala | 4 +- .../org/neo4j/cypher/QueryCachingTest.scala | 2 +- .../neo4j/cypher/QueryPlanTestSupport.scala | 2 +- .../neo4j/cypher/RootPlanAcceptanceTest.scala | 2 +- .../cypher/SystemPropertyTestSupport.scala | 2 +- .../SystemPropertyTestSupportTest.scala | 2 +- .../cypher/TxCountsTrackingTestSupport.scala | 2 +- .../internal/PlanStalenessCallerTest.scala | 4 +- .../neo4j/cypher/internal/PreParserTest.scala | 2 +- .../codegen/CompiledConversionUtilsTest.scala | 4 +- .../codegen/CompiledCursorUtilsTest.scala | 2 +- .../codegen/CompiledMathHelperTest.scala | 2 +- .../internal/compatibility/LFUCacheTest.scala | 2 +- .../v3_3/ActiveReadInjectorTest.scala | 8 +- .../v3_3/LogicalPlanConverterTest.scala | 12 +- .../v3_5/CheckForEagerLoadCsvTest.scala | 6 +- ...ckForLoadCsvAndMatchOnLargeLabelTest.scala | 7 +- ...CypherCompilerAstCacheAcceptanceTest.scala | 8 +- .../v3_5/runtime/ClosingIteratorTest.scala | 4 +- .../runtime/PipeExecutionPlanBuilderIT.scala | 8 +- .../PipeExecutionPlanBuilderTest.scala | 4 +- .../ExecutionWorkflowBuilderTest.scala | 4 +- .../executionplan/LoadCsvIteratorTest.scala | 2 +- .../LoadCsvPeriodicCommitObserverTest.scala | 2 +- .../builders/PatternGraphBuilderTest.scala | 6 +- .../ProcedureCallExecutionPlanTest.scala | 8 +- .../helpers/RowIteratorVisitationTest.scala | 2 +- .../simpleExpressionEvaluatorTest.scala | 6 +- .../v3_5/runtime/profiler/ProfilerTest.scala | 4 +- .../compiler/CypherPreParserTest.scala | 4 +- .../v3_4/ActualCostCalculationTest.scala | 8 +- .../compiler/v3_4/PathExpressionTest.scala | 2 +- .../compiler/v3_4/PatternMatchingTest.scala | 4 +- .../compiler/v3_4/PatternNodeTest.scala | 2 +- .../compiler/v3_4/PipeLazynessTest.scala | 4 +- .../v3_4/ScalaPatternMatchingTest.scala | 4 +- .../javacompat/ResultRowImplTest.scala | 2 +- .../internal/parser/CaseExpressionTest.scala | 4 +- .../internal/parser/ExpressionsTest.scala | 4 +- .../parser/ListComprehensionTest.scala | 4 +- .../internal/parser/MapLiteralTest.scala | 4 +- .../tracing/TimingCompilationTracerTest.scala | 6 +- .../cypher/expressions-3.5/ASL-2-header.txt | 14 - community/cypher/expressions-3.5/LICENSES.txt | 291 ---- community/cypher/expressions-3.5/NOTICE.txt | 29 - community/cypher/expressions-3.5/pom.xml | 104 -- .../AndedPropertyInequalities.scala | 27 - .../expressions/ArithmeticExpressions.scala | 134 -- .../v3_5/expressions/CaseExpression.scala | 38 - .../internal/v3_5/expressions/CoerceTo.scala | 23 - .../v3_5/expressions/ConstantExpression.scala | 26 - .../internal/v3_5/expressions/CountStar.scala | 21 - .../v3_5/expressions/Expression.scala | 149 -- .../v3_5/expressions/FunctionInvocation.scala | 53 - .../internal/v3_5/expressions/GetDegree.scala | 25 - .../internal/v3_5/expressions/HasLabels.scala | 24 - .../v3_5/expressions/IsAggregate.scala | 43 - .../expressions/IterableExpressions.scala | 155 -- .../v3_5/expressions/ListLiteral.scala | 32 - .../internal/v3_5/expressions/Literal.scala | 92 -- .../v3_5/expressions/LogicalProperty.scala | 26 - .../v3_5/expressions/LogicalVariable.scala | 36 - .../v3_5/expressions/MapExpression.scala | 26 - .../v3_5/expressions/MapProjection.scala | 38 - .../internal/v3_5/expressions/NameToken.scala | 36 - .../v3_5/expressions/OperatorExpression.scala | 60 - .../internal/v3_5/expressions/Parameter.scala | 27 - .../v3_5/expressions/PathExpression.scala | 57 - .../internal/v3_5/expressions/Pattern.scala | 174 --- .../v3_5/expressions/PatternExpression.scala | 21 - .../expressions/PredicateExpressions.scala | 212 --- .../internal/v3_5/expressions/Property.scala | 23 - .../internal/v3_5/expressions/Range.scala | 21 - .../v3_5/expressions/ScopeExpression.scala | 44 - .../v3_5/expressions/SemanticDirection.scala | 27 - .../expressions/ShortestPathExpression.scala | 21 - .../v3_5/expressions/SymbolicName.scala | 37 - .../v3_5/expressions/TypeSignature.scala | 21 - .../v3_5/expressions/TypeSignatures.scala | 24 - .../internal/v3_5/expressions/Variable.scala | 37 - .../v3_5/expressions/containsAggregate.scala | 25 - .../cypher/internal/v3_5/functions/Abs.scala | 29 - .../cypher/internal/v3_5/functions/Acos.scala | 28 - .../cypher/internal/v3_5/functions/Asin.scala | 28 - .../cypher/internal/v3_5/functions/Atan.scala | 28 - .../internal/v3_5/functions/Atan2.scala | 28 - .../cypher/internal/v3_5/functions/Avg.scala | 29 - .../cypher/internal/v3_5/functions/Ceil.scala | 28 - .../internal/v3_5/functions/Coalesce.scala | 21 - .../internal/v3_5/functions/Collect.scala | 21 - .../cypher/internal/v3_5/functions/Cos.scala | 28 - .../cypher/internal/v3_5/functions/Cot.scala | 28 - .../internal/v3_5/functions/Count.scala | 28 - .../internal/v3_5/functions/Degrees.scala | 28 - .../internal/v3_5/functions/Distance.scala | 33 - .../cypher/internal/v3_5/functions/E.scala | 28 - .../internal/v3_5/functions/EndNode.scala | 28 - .../internal/v3_5/functions/Exists.scala | 21 - .../cypher/internal/v3_5/functions/Exp.scala | 28 - .../internal/v3_5/functions/Floor.scala | 28 - .../internal/v3_5/functions/Function.scala | 111 -- .../internal/v3_5/functions/Haversin.scala | 28 - .../cypher/internal/v3_5/functions/Head.scala | 21 - .../cypher/internal/v3_5/functions/Id.scala | 29 - .../cypher/internal/v3_5/functions/Keys.scala | 30 - .../internal/v3_5/functions/LTrim.scala | 28 - .../internal/v3_5/functions/Labels.scala | 28 - .../cypher/internal/v3_5/functions/Last.scala | 21 - .../cypher/internal/v3_5/functions/Left.scala | 28 - .../internal/v3_5/functions/Length.scala | 31 - .../cypher/internal/v3_5/functions/Log.scala | 28 - .../internal/v3_5/functions/Log10.scala | 28 - .../cypher/internal/v3_5/functions/Max.scala | 21 - .../cypher/internal/v3_5/functions/Min.scala | 21 - .../internal/v3_5/functions/Nodes.scala | 28 - .../v3_5/functions/PercentileCont.scala | 28 - .../v3_5/functions/PercentileDisc.scala | 29 - .../cypher/internal/v3_5/functions/Pi.scala | 28 - .../internal/v3_5/functions/Point.scala | 28 - .../internal/v3_5/functions/Properties.scala | 30 - .../internal/v3_5/functions/RTrim.scala | 28 - .../internal/v3_5/functions/Radians.scala | 28 - .../cypher/internal/v3_5/functions/Rand.scala | 28 - .../internal/v3_5/functions/Range.scala | 29 - .../internal/v3_5/functions/Reduce.scala | 23 - .../v3_5/functions/Relationships.scala | 28 - .../internal/v3_5/functions/Replace.scala | 28 - .../internal/v3_5/functions/Reverse.scala | 29 - .../internal/v3_5/functions/Right.scala | 28 - .../internal/v3_5/functions/Round.scala | 28 - .../cypher/internal/v3_5/functions/Sign.scala | 29 - .../cypher/internal/v3_5/functions/Sin.scala | 28 - .../cypher/internal/v3_5/functions/Size.scala | 29 - .../internal/v3_5/functions/Split.scala | 28 - .../cypher/internal/v3_5/functions/Sqrt.scala | 28 - .../internal/v3_5/functions/StartNode.scala | 28 - .../internal/v3_5/functions/StdDev.scala | 28 - .../internal/v3_5/functions/StdDevP.scala | 28 - .../internal/v3_5/functions/Substring.scala | 29 - .../cypher/internal/v3_5/functions/Sum.scala | 29 - .../cypher/internal/v3_5/functions/Tail.scala | 21 - .../cypher/internal/v3_5/functions/Tan.scala | 28 - .../internal/v3_5/functions/Timestamp.scala | 28 - .../internal/v3_5/functions/ToBoolean.scala | 21 - .../internal/v3_5/functions/ToFloat.scala | 29 - .../internal/v3_5/functions/ToInteger.scala | 29 - .../internal/v3_5/functions/ToLower.scala | 28 - .../internal/v3_5/functions/ToString.scala | 38 - .../internal/v3_5/functions/ToUpper.scala | 28 - .../cypher/internal/v3_5/functions/Trim.scala | 28 - .../cypher/internal/v3_5/functions/Type.scala | 28 - .../v3_5/functions/UnresolvedFunction.scala | 21 - .../UserDefinedFunctionInvocation.scala | 21 - .../v3_5/expressions/DummyExpression.scala | 25 - .../cypher/frontend-3.5/ASL-2-header.txt | 14 - community/cypher/frontend-3.5/LICENSES.txt | 291 ---- community/cypher/frontend-3.5/NOTICE.txt | 29 - community/cypher/frontend-3.5/pom.xml | 132 -- .../v3_5/phases/CompilationPhaseTracer.java | 52 - .../frontend/v3_5/AstRewritingMonitor.scala | 22 - .../internal/frontend/v3_5/IdentityMap.scala | 65 - .../internal/frontend/v3_5/PlannerName.scala | 26 - .../frontend/v3_5/ScopeTreeVerifier.scala | 36 - .../frontend/v3_5/ast/ASTAnnotationMap.scala | 56 - .../frontend/v3_5/ast/ASTSlicingPhrase.scala | 61 - .../internal/frontend/v3_5/ast/Clause.scala | 652 --------- .../internal/frontend/v3_5/ast/Command.scala | 123 -- .../internal/frontend/v3_5/ast/GraphRef.scala | 32 - .../frontend/v3_5/ast/GraphReturnItems.scala | 141 -- .../internal/frontend/v3_5/ast/GraphUrl.scala | 37 - .../internal/frontend/v3_5/ast/Hint.scala | 129 -- .../internal/frontend/v3_5/ast/Limit.scala | 24 - .../frontend/v3_5/ast/MergeAction.scala | 31 - .../internal/frontend/v3_5/ast/Order.scala | 44 - .../v3_5/ast/PeriodicCommitHint.scala | 33 - .../frontend/v3_5/ast/ProcedureResult.scala | 34 - .../v3_5/ast/ProcedureResultItem.scala | 48 - .../internal/frontend/v3_5/ast/Query.scala | 188 --- .../frontend/v3_5/ast/RemoveItem.scala | 36 - .../frontend/v3_5/ast/ReturnItem.scala | 123 -- .../internal/frontend/v3_5/ast/SetItem.scala | 57 - .../frontend/v3_5/ast/SingleGraphAs.scala | 110 -- .../internal/frontend/v3_5/ast/Skip.scala | 25 - .../frontend/v3_5/ast/Statement.scala | 27 - .../internal/frontend/v3_5/ast/Where.scala | 32 - .../ast/conditions/StatementCondition.scala | 31 - .../conditions/aggregationsAreIsolated.scala | 32 - .../ast/conditions/collectNodesOfType.scala | 29 - .../conditions/containsNoMatchingNodes.scala | 30 - .../conditions/containsNoNodesOfType.scala | 30 - .../ast/conditions/containsNoReturnAll.scala | 29 - .../noDuplicatesInReturnItems.scala | 32 - .../noReferenceEqualityAmongVariables.scala | 32 - .../v3_5/ast/conditions/noUnnamedGraphs.scala | 30 - .../noUnnamedPatternElementsInGraphOf.scala | 44 - .../noUnnamedPatternElementsInMatch.scala | 44 - ...atternElementsInPatternComprehension.scala | 35 - .../normalizedEqualsArguments.scala | 40 - .../conditions/orderByOnlyOnVariables.scala | 35 - .../v3_5/ast/connectedComponents.scala | 69 - .../ast/hasAggregateButIsNotAggregate.scala | 26 - .../v3_5/ast/rewriters/ASTRewriter.scala | 70 - .../v3_5/ast/rewriters/CNFNormalizer.scala | 147 -- .../rewriters/LabelPredicateNormalizer.scala | 29 - .../MatchPredicateNormalization.scala | 80 -- .../rewriters/MatchPredicateNormalizer.scala | 24 - .../MatchPredicateNormalizerChain.scala | 25 - .../v3_5/ast/rewriters/Namespacer.scala | 107 -- ...PatternExpressionPatternElementNamer.scala | 70 - .../PropertyPredicateNormalizer.scala | 69 - .../ReturnItemSafeTopDownRewriter.scala | 71 - .../ast/rewriters/StatementRewriter.scala | 33 - .../rewriters/addUniquenessPredicates.scala | 106 -- .../collapseMultipleInPredicates.scala | 62 - .../v3_5/ast/rewriters/copyVariables.scala | 26 - .../createGraphIntroducesHorizon.scala | 52 - .../ast/rewriters/desugarMapProjection.scala | 66 - .../v3_5/ast/rewriters/expandCallWhere.scala | 43 - .../v3_5/ast/rewriters/expandStar.scala | 109 -- .../v3_5/ast/rewriters/foldConstants.scala | 119 -- ...ineNamedPathsInPatternComprehensions.scala | 42 - .../ast/rewriters/isolateAggregation.scala | 128 -- .../ast/rewriters/literalReplacement.scala | 116 -- .../ast/rewriters/mergeInPredicates.scala | 94 -- .../rewriters/nameAllPatternElements.scala | 35 - .../nameGraphOfPatternElements.scala | 34 - .../rewriters/nameMatchPatternElements.scala | 34 - ...ePatternComprehensionPatternElements.scala | 31 - .../ast/rewriters/nameUpdatingClauses.scala | 42 - .../rewriters/normalizeArgumentOrder.scala | 56 - .../ast/rewriters/normalizeComparisons.scala | 45 - .../rewriters/normalizeGraphReturnItems.scala | 38 - .../rewriters/normalizeMatchPredicates.scala | 20 - .../ast/rewriters/normalizeNotEquals.scala | 30 - .../rewriters/normalizeReturnClauses.scala | 100 -- .../ast/rewriters/normalizeWithClauses.scala | 210 --- .../projectFreshSortExpressions.scala | 76 - .../ast/rewriters/projectNamedPaths.scala | 143 -- .../v3_5/ast/rewriters/recordScopes.scala | 33 - .../ast/rewriters/repeatWithSizeLimit.scala | 56 - .../replaceAliasedFunctionInvocations.scala | 46 - ...replaceLiteralDynamicPropertyLookups.scala | 30 - .../rewriteEqualityToInPredicate.scala | 44 - .../ast/rewriters/transitiveClosure.scala | 98 -- .../v3_5/helpers/PartialFunctionSupport.scala | 48 - .../frontend/v3_5/helpers/SeqCombiner.scala | 58 - .../frontend/v3_5/helpers/StringHelper.scala | 43 - .../frontend/v3_5/helpers/TreeZipper.scala | 180 --- .../helpers/calculateUsingGetDegree.scala | 33 - .../frontend/v3_5/helpers/fixedPoint.scala | 33 - .../frontend/v3_5/helpers/package.scala | 57 - .../helpers/rewriting/RewriterCondition.scala | 28 - .../v3_5/helpers/rewriting/RewriterStep.scala | 35 - .../rewriting/RewriterStepSequencer.scala | 71 - .../v3_5/helpers/rewriting/RewriterTask.scala | 23 - .../rewriting/RewriterTaskBuilder.scala | 38 - .../rewriting/RewriterTaskProcessor.scala | 94 -- .../notification/InternalNotification.scala | 72 - .../internal/frontend/v3_5/package.scala | 96 -- .../internal/frontend/v3_5/parser/Base.scala | 270 ---- .../frontend/v3_5/parser/BufferPosition.scala | 33 - .../frontend/v3_5/parser/Clauses.scala | 251 ---- .../frontend/v3_5/parser/Command.scala | 124 -- .../frontend/v3_5/parser/CypherParser.scala | 37 - .../frontend/v3_5/parser/Expressions.scala | 219 --- .../frontend/v3_5/parser/Graphs.scala | 137 -- .../parser/InvalidInputErrorFormatter.scala | 87 -- .../v3_5/parser/LikePatternParser.scala | 81 -- .../frontend/v3_5/parser/Literals.scala | 167 --- .../frontend/v3_5/parser/Patterns.scala | 133 -- .../frontend/v3_5/parser/ProcedureCalls.scala | 70 - .../internal/frontend/v3_5/parser/Query.scala | 75 - .../frontend/v3_5/parser/StartPoints.scala | 89 -- .../frontend/v3_5/parser/Statement.scala | 31 - .../frontend/v3_5/parser/Strings.scala | 58 - .../parser/convertLikePatternToRegex.scala | 33 - .../matchers/IdentifierPartMatcher.scala | 21 - .../matchers/IdentifierStartMatcher.scala | 21 - .../parser/matchers/ScalaCharMatcher.scala | 42 - .../matchers/WhitespaceCharMatcher.scala | 21 - .../frontend/v3_5/parser/package.scala | 26 - .../frontend/v3_5/phases/AstRewriting.scala | 57 - .../frontend/v3_5/phases/BaseContext.scala | 28 - .../frontend/v3_5/phases/BaseState.scala | 74 - .../v3_5/phases/CompilationPhases.scala | 40 - .../frontend/v3_5/phases/Condition.scala | 45 - .../phases/InternalNotificationLogger.scala | 51 - .../v3_5/phases/LateAstRewriting.scala | 34 - .../frontend/v3_5/phases/Monitors.scala | 24 - .../frontend/v3_5/phases/Parsing.scala | 34 - .../internal/frontend/v3_5/phases/Phase.scala | 68 - .../v3_5/phases/PreparatoryRewriting.scala | 44 - .../v3_5/phases/SemanticAnalysis.scala | 48 - .../phases/SyntaxDeprecationWarnings.scala | 45 - .../frontend/v3_5/phases/Transformer.scala | 93 -- .../prettifier/ExpressionStringifier.scala | 261 ---- .../frontend/v3_5/prettifier/Prettifier.scala | 99 -- .../semantics/SemanticAnalysisTooling.scala | 221 --- .../v3_5/semantics/SemanticCheck.scala | 73 - .../v3_5/semantics/SemanticChecker.scala | 32 - .../v3_5/semantics/SemanticError.scala | 33 - .../semantics/SemanticExpressionCheck.scala | 643 --------- .../v3_5/semantics/SemanticFeature.scala | 24 - .../semantics/SemanticFunctionCheck.scala | 239 --- .../v3_5/semantics/SemanticPatternCheck.scala | 258 ---- .../v3_5/semantics/SemanticState.scala | 511 ------- .../v3_5/semantics/SemanticTable.scala | 112 -- .../internal/frontend/v3_5/FoldableTest.scala | 85 -- .../internal/frontend/v3_5/RepeatTest.scala | 57 - .../frontend/v3_5/SemanticAnalysisTest.scala | 69 - .../frontend/v3_5/ast/ASTNodeTest.scala | 67 - .../v3_5/ast/AstConstructionTestSupport.scala | 80 -- .../v3_5/ast/ConnectedComponentsTest.scala | 76 - .../v3_5/ast/ConstantExpressionTest.scala | 34 - .../v3_5/ast/ContainsAggregateTest.scala | 35 - .../ast/ExpressionCallTypeCheckerTest.scala | 118 -- .../frontend/v3_5/ast/ExpressionTest.scala | 148 -- .../ast/FindDuplicateRelationshipsTest.scala | 66 - .../frontend/v3_5/ast/FunctionNameTest.scala | 29 - .../v3_5/ast/GraphReturnItemsTest.scala | 137 -- .../frontend/v3_5/ast/IsAggregateTest.scala | 53 - .../frontend/v3_5/ast/LoadCSVTest.scala | 65 - .../frontend/v3_5/ast/MapProjectionTest.scala | 60 - ...tipleGraphClauseSemanticCheckingTest.scala | 1279 ----------------- .../v3_5/ast/PeriodicCommitHintTest.scala | 114 -- .../v3_5/ast/ProjectionClauseTest.scala | 188 --- .../frontend/v3_5/ast/ReturnItemsTest.scala | 59 - .../frontend/v3_5/ast/SetClauseTest.scala | 39 - .../frontend/v3_5/ast/SingleGraphTest.scala | 33 - .../v3_5/ast/StatementReturnColumnsTest.scala | 52 - .../frontend/v3_5/ast/TestExpression.scala | 35 - .../v3_5/helpers/NonEmptyListTest.scala | 223 --- .../v3_5/helpers/StatementHelper.scala | 37 - .../v3_5/helpers/StringHelperTest.scala | 41 - .../rewriting/RewriterStepSequencerTest.scala | 80 -- .../frontend/v3_5/parser/BaseRulesTest.scala | 31 - .../frontend/v3_5/parser/ComparisonTest.scala | 43 - .../parser/FunctionInvocationParserTest.scala | 62 - .../parser/GraphReturnItemsParserTest.scala | 179 --- .../v3_5/parser/GraphsParserTest.scala | 97 -- .../frontend/v3_5/parser/LiteralsTest.scala | 106 -- .../MultipleGraphClausesParsingTest.scala | 120 -- .../parser/MultipleGraphsParserTest.scala | 83 -- .../frontend/v3_5/parser/ParserAstTest.scala | 50 - .../frontend/v3_5/parser/ParserTest.scala | 81 -- .../v3_5/parser/ProcedureCallParserTest.scala | 93 -- .../parser/ProjectionClauseParserTest.scala | 185 --- .../ExpressionStringifierTest.scala | 91 -- .../v3_5/prettifier/PrettifierTest.scala | 88 -- .../frontend/v3_5/semantics/AddTest.scala | 137 -- .../frontend/v3_5/semantics/AndTest.scala | 38 - .../v3_5/semantics/ContainerIndexTest.scala | 98 -- .../frontend/v3_5/semantics/DivideTest.scala | 52 - .../v3_5/semantics/FilterExpressionTest.scala | 50 - .../semantics/FilteringExpressionTest.scala | 41 - .../semantics/GreaterThanOrEqualTest.scala | 54 - .../v3_5/semantics/GreaterThanTest.scala | 54 - .../semantics/HexIntegerLiteralTest.scala | 47 - .../semantics/InfixExpressionTestBase.scala | 45 - .../v3_5/semantics/LessThanOrEqualTest.scala | 54 - .../v3_5/semantics/LessThanTest.scala | 54 - .../semantics/ListComprehensionTest.scala | 54 - .../v3_5/semantics/ListSliceTest.scala | 53 - .../frontend/v3_5/semantics/LiteralTest.scala | 129 -- .../frontend/v3_5/semantics/ModuloTest.scala | 50 - .../v3_5/semantics/MultiplyTest.scala | 54 - .../frontend/v3_5/semantics/OrTest.scala | 38 - .../semantics/PatternComprehensionTest.scala | 77 - .../frontend/v3_5/semantics/PowTest.scala | 50 - .../v3_5/semantics/PropertyTest.scala | 100 -- .../v3_5/semantics/ReduceExpressionTest.scala | 104 -- .../SemanticAnalysisToolingTest.scala | 71 - .../SemanticCaseExpressionTest.scala | 86 -- .../SemanticExtractExpressionTest.scala | 49 - .../v3_5/semantics/SemanticFunSuite.scala | 58 - .../ShortestPathExpressionTest.scala | 67 - .../v3_5/semantics/SubtractTest.scala | 56 - .../v3_5/semantics/VariableTest.scala | 35 - .../frontend/v3_5/semantics/XorTest.scala | 38 - .../v3_5/semantics/functions/AbsTest.scala | 40 - .../semantics/functions/DistanceTest.scala | 45 - .../functions/FunctionTestBase.scala | 53 - .../v3_5/semantics/functions/LabelsTest.scala | 35 - .../functions/PercentileContTest.scala | 50 - .../functions/PercentileDiscTest.scala | 50 - .../v3_5/semantics/functions/PointTest.scala | 45 - .../semantics/functions/ReverseTest.scala | 37 - .../v3_5/semantics/functions/SplitTest.scala | 50 - .../semantics/functions/ToFloatTest.scala | 53 - .../semantics/functions/ToIntegerTest.scala | 53 - .../semantics/functions/ToStringTest.scala | 57 - .../v3_5/symbols/CypherTypeTest.scala | 78 - .../frontend/v3_5/symbols/TypeRangeTest.scala | 215 --- .../frontend/v3_5/symbols/TypeSpecTest.scala | 381 ----- .../cypher/interpreted-runtime/LICENSES.txt | 6 + .../cypher/interpreted-runtime/NOTICE.txt | 6 + community/cypher/interpreted-runtime/pom.xml | 6 +- .../runtime/interpreted/CSVResources.scala | 2 +- .../runtime/interpreted/CastSupport.scala | 2 +- .../interpreted/DelegatingQueryContext.scala | 2 +- .../interpreted/ExecutionContext.scala | 2 +- .../interpreted/InterpretedPipeBuilder.scala | 6 +- .../interpreted/PatternGraphBuilder.scala | 2 +- .../TransactionBoundGraphStatistics.scala | 2 +- .../TransactionBoundPlanContext.scala | 6 +- .../TransactionBoundQueryContext.scala | 6 +- .../UpdateCountingQueryContext.scala | 2 +- .../runtime/interpreted/ValueConversion.scala | 4 +- .../interpreted/commands/AstNode.scala | 2 +- .../interpreted/commands/PathExpression.scala | 4 +- .../interpreted/commands/Pattern.scala | 8 +- .../interpreted/commands/ReturnItem.scala | 2 +- .../interpreted/commands/SortItem.scala | 2 +- .../runtime/interpreted/commands/coerce.scala | 4 +- .../CommunityExpressionConverter.scala | 8 +- .../convert/ExpressionConverters.scala | 6 +- .../commands/convert/PatternConverters.scala | 4 +- .../commands/expressions/Add.scala | 4 +- .../expressions/AggregationExpression.scala | 4 +- .../commands/expressions/Avg.scala | 2 +- .../expressions/CoalesceFunction.scala | 2 +- .../commands/expressions/CoerceTo.scala | 2 +- .../commands/expressions/Collect.scala | 2 +- .../commands/expressions/ContainerIndex.scala | 2 +- .../commands/expressions/Count.scala | 2 +- .../commands/expressions/Distinct.scala | 2 +- .../commands/expressions/Divide.scala | 2 +- .../commands/expressions/Expression.scala | 4 +- .../commands/expressions/GetDegree.scala | 4 +- .../commands/expressions/IdFunction.scala | 2 +- .../InequalitySeekRangeExpression.scala | 2 +- .../commands/expressions/KeysFunction.scala | 2 +- .../commands/expressions/LabelsFunction.scala | 2 +- .../commands/expressions/MathFunction.scala | 4 +- .../commands/expressions/Max.scala | 2 +- .../commands/expressions/Min.scala | 2 +- .../commands/expressions/NodesFunction.scala | 2 +- .../commands/expressions/Percentile.scala | 2 +- .../PointDistanceSeekRangeExpression.scala | 2 +- .../commands/expressions/PointFunction.scala | 2 +- .../PrefixSeekRangeExpression.scala | 2 +- .../expressions/PropertiesFunction.scala | 2 +- .../commands/expressions/Property.scala | 2 +- .../commands/expressions/ReduceFunction.scala | 2 +- .../expressions/RelationshipFunction.scala | 2 +- .../RelationshipTypeFunction.scala | 2 +- .../expressions/ReverseFunction.scala | 2 +- .../expressions/ShortestPathExpression.scala | 2 +- .../expressions/ShortestPathSPI.scala | 2 +- .../commands/expressions/SizeFunction.scala | 2 +- .../commands/expressions/Stdev.scala | 2 +- .../expressions/StringFunctions.scala | 4 +- .../commands/expressions/Subtract.scala | 2 +- .../commands/expressions/Sum.scala | 2 +- .../expressions/TimestampFunction.scala | 2 +- .../expressions/ToBooleanFunction.scala | 2 +- .../expressions/ToFloatFunction.scala | 2 +- .../expressions/ToIntegerFunction.scala | 2 +- .../commands/predicates/Ands.scala | 2 +- .../interpreted/commands/predicates/Ors.scala | 2 +- .../commands/predicates/Predicate.scala | 2 +- .../groupInequalityPredicatesForLegacy.scala | 2 +- .../interpreted/makeValueNeoSafe.scala | 2 +- .../interpreted/pipes/ActiveReadPipe.scala | 2 +- .../interpreted/pipes/AllNodesScanPipe.scala | 2 +- .../runtime/interpreted/pipes/ApplyPipe.scala | 2 +- .../pipes/AssertSameNodePipe.scala | 4 +- .../interpreted/pipes/CachingExpandInto.scala | 4 +- .../pipes/CartesianProductPipe.scala | 2 +- .../pipes/ConditionalApplyPipe.scala | 2 +- .../pipes/ConstraintOperationPipe.scala | 2 +- .../interpreted/pipes/CreateNodePipe.scala | 4 +- .../pipes/CreateRelationshipPipe.scala | 4 +- .../interpreted/pipes/DeletePipe.scala | 4 +- .../DirectedRelationshipByIdSeekPipe.scala | 2 +- .../interpreted/pipes/DistinctPipe.scala | 4 +- .../interpreted/pipes/DropResultPipe.scala | 2 +- .../pipes/EagerAggregationPipe.scala | 2 +- .../runtime/interpreted/pipes/EagerPipe.scala | 2 +- .../interpreted/pipes/EmptyResultPipe.scala | 2 +- .../runtime/interpreted/pipes/ErrorPipe.scala | 2 +- .../interpreted/pipes/ExpandAllPipe.scala | 6 +- .../interpreted/pipes/ExpandIntoPipe.scala | 4 +- .../interpreted/pipes/FilterPipe.scala | 2 +- .../interpreted/pipes/ForeachPipe.scala | 2 +- .../pipes/IndexOperationPipe.scala | 4 +- .../interpreted/pipes/IndexSeekMode.scala | 2 +- .../runtime/interpreted/pipes/LazyLabel.scala | 6 +- .../interpreted/pipes/LazyPropertyKey.scala | 6 +- .../runtime/interpreted/pipes/LazyType.scala | 4 +- .../runtime/interpreted/pipes/LazyTypes.scala | 4 +- .../pipes/LetSelectOrSemiApplyPipe.scala | 2 +- .../interpreted/pipes/LetSemiApplyPipe.scala | 2 +- .../runtime/interpreted/pipes/LimitPipe.scala | 2 +- .../interpreted/pipes/LoadCSVPipe.scala | 4 +- .../interpreted/pipes/LockNodesPipe.scala | 2 +- .../pipes/NestedPipeExpression.scala | 10 +- .../interpreted/pipes/NodeByIdSeekPipe.scala | 2 +- .../pipes/NodeByLabelScanPipe.scala | 2 +- .../pipes/NodeCountFromCountStorePipe.scala | 4 +- .../interpreted/pipes/NodeHashJoinPipe.scala | 4 +- .../pipes/NodeIndexContainsScanPipe.scala | 6 +- .../interpreted/pipes/NodeIndexScanPipe.scala | 4 +- .../interpreted/pipes/NodeIndexSeekPipe.scala | 4 +- .../interpreted/pipes/NodeIndexSeeker.scala | 4 +- .../pipes/NodeLeftOuterHashJoinPipe.scala | 2 +- .../pipes/NodeRightOuterHashJoinPipe.scala | 2 +- .../pipes/OptionalExpandAllPipe.scala | 6 +- .../pipes/OptionalExpandIntoPipe.scala | 4 +- .../interpreted/pipes/OptionalPipe.scala | 2 +- .../runtime/interpreted/pipes/Pipe.scala | 4 +- .../pipes/PipeBuilderFactory.scala | 4 +- .../pipes/PipeExecutionBuilderContext.scala | 2 +- .../interpreted/pipes/ProcedureCallPipe.scala | 4 +- .../pipes/ProduceResultsPipe.scala | 2 +- .../pipes/ProjectEndpointsPipe.scala | 2 +- .../interpreted/pipes/ProjectionPipe.scala | 2 +- .../pipes/PruningVarLengthExpandPipe.scala | 6 +- .../interpreted/pipes/QueryState.scala | 2 +- .../RelationshipCountFromCountStorePipe.scala | 4 +- .../interpreted/pipes/RemoveLabelsPipe.scala | 2 +- .../interpreted/pipes/RollUpApplyPipe.scala | 2 +- .../runtime/interpreted/pipes/SeekRhs.scala | 2 +- .../pipes/SelectOrSemiApplyPipe.scala | 2 +- .../interpreted/pipes/SemiApplyPipe.scala | 2 +- .../interpreted/pipes/SetOperation.scala | 2 +- .../runtime/interpreted/pipes/SetPipe.scala | 2 +- .../interpreted/pipes/ShortestPathPipe.scala | 2 +- .../runtime/interpreted/pipes/SkipPipe.scala | 2 +- .../runtime/interpreted/pipes/SortPipe.scala | 2 +- .../runtime/interpreted/pipes/TopPipe.scala | 2 +- .../pipes/TriadicSelectionPipe.scala | 4 +- .../UndirectedRelationshipByIdSeekPipe.scala | 2 +- .../runtime/interpreted/pipes/UnionPipe.scala | 2 +- .../interpreted/pipes/UnwindPipe.scala | 2 +- .../interpreted/pipes/ValueHashJoinPipe.scala | 2 +- .../pipes/VarLengthExpandPipe.scala | 6 +- .../aggregation/NumericExpressionOnly.scala | 2 +- .../aggregation/PercentileFunction.scala | 2 +- .../pipes/matching/MatchingContext.scala | 2 +- .../pipes/matching/PatternGraph.scala | 2 +- .../matching/PatternMatchingBuilder.scala | 2 +- .../pipes/matching/PatternNode.scala | 2 +- .../pipes/matching/PatternRelationship.scala | 6 +- .../interpreted/symbols/SymbolTable.scala | 4 +- .../interpreted/CSVResourcesTest.scala | 4 +- .../runtime/interpreted/CastSupportTest.scala | 4 +- .../GraphElementPropertyFunctionsTest.scala | 2 +- .../interpreted/ImplicitDummyPos.scala | 2 +- .../LastCommittedTxIdProviderTest.scala | 2 +- .../interpreted/MakeValuesNeoSafeTest.scala | 4 +- .../interpreted/MatchingContextTest.scala | 4 +- .../interpreted/QueryContextAdaptation.scala | 2 +- .../interpreted/ResourceManagerTest.scala | 2 +- .../runtime/interpreted/SeekRangeTest.scala | 4 +- .../TransactionBoundPlanContextTest.scala | 6 +- .../TransactionBoundQueryContextTest.scala | 4 +- .../UpdateCountingQueryContextTest.scala | 2 +- .../interpreted/commands/AddTest.scala | 4 +- .../commands/AllVariablesTest.scala | 4 +- .../interpreted/commands/AndsTest.scala | 4 +- .../interpreted/commands/CoalesceTest.scala | 2 +- .../commands/CoercedPredicateTest.scala | 2 +- .../commands/ComparablePredicateTest.scala | 2 +- .../interpreted/commands/ExtractTest.scala | 2 +- .../interpreted/commands/HasLabelTests.scala | 2 +- .../commands/LengthFunctionTest.scala | 2 +- .../commands/ListLiteralTest.scala | 2 +- .../commands/MathFunctionsTest.scala | 4 +- .../interpreted/commands/OrsTest.scala | 4 +- .../commands/PatternComprehensionTest.scala | 4 +- .../PropertyValueComparisonTest.scala | 2 +- .../interpreted/commands/ReduceTest.scala | 2 +- .../RegularExpressionPredicateTest.scala | 2 +- .../commands/SizeFunctionTest.scala | 4 +- .../commands/SplittingPredicateTest.scala | 2 +- .../interpreted/commands/SubtractTest.scala | 4 +- .../PathExpressionConversionTest.scala | 6 +- .../commands/expressions/CoerceToTest.scala | 6 +- .../expressions/ContainerIndexTest.scala | 4 +- .../expressions/DistanceFunctionTest.scala | 2 +- .../commands/expressions/DivideTest.scala | 4 +- .../commands/expressions/ExpressionTest.scala | 4 +- .../expressions/GenericCaseTest.scala | 2 +- .../IndexedInclusiveLongRangeTest.scala | 2 +- .../expressions/KeysFunctionTest.scala | 2 +- .../expressions/LabelsFunctionTest.scala | 2 +- .../commands/expressions/ListSliceTest.scala | 2 +- .../commands/expressions/LiteralMapTest.scala | 2 +- .../commands/expressions/ModuloTest.scala | 2 +- .../commands/expressions/PathImplTest.scala | 2 +- .../expressions/PathValueBuilderTest.scala | 2 +- .../expressions/PropertiesFunctionTest.scala | 4 +- .../expressions/RangeFunctionTest.scala | 2 +- .../RelationshipTypeFunctionTest.scala | 4 +- .../ShortestPathNoDuplicatesTest.scala | 2 +- .../commands/expressions/SimpleCaseTest.scala | 2 +- .../expressions/SplitFunctionTest.scala | 2 +- .../expressions/StringFunctionsTest.scala | 4 +- .../expressions/ToBooleanFunctionTest.scala | 4 +- .../expressions/ToFloatFunctionTest.scala | 4 +- .../expressions/ToIntegerFunctionTest.scala | 4 +- .../expressions/ToStringFunctionTest.scala | 4 +- .../commands/expressions/TypeTest.scala | 2 +- ...oupInequalityPredicatesForLegacyTest.scala | 4 +- .../commands/predicates/CheckerTest.scala | 2 +- .../predicates/ConstantCachedInTest.scala | 2 +- .../commands/values/KeyTokenTest.scala | 2 +- .../pipes/AllNodesScanPipeTest.scala | 2 +- .../pipes/AllShortestPathsPipeTest.scala | 4 +- .../interpreted/pipes/ApplyPipeTest.scala | 4 +- ...DirectedRelationshipByIdSeekPipeTest.scala | 2 +- .../interpreted/pipes/DistinctPipeTest.scala | 4 +- .../pipes/EagerAggregationPipeTest.scala | 4 +- .../interpreted/pipes/EagerPipeTest.scala | 2 +- .../interpreted/pipes/ErrorPipeTest.scala | 2 +- .../interpreted/pipes/ExpandAllPipeTest.scala | 4 +- .../pipes/ExpandIntoPipeTest.scala | 6 +- .../runtime/interpreted/pipes/FakePipe.scala | 4 +- .../pipes/LazyGroupingIteratorTest.scala | 2 +- .../pipes/LazyPropertyKeyTest.scala | 8 +- .../interpreted/pipes/LazyTypesTest.scala | 2 +- .../LegacyPruningVarLengthExpandPipe.scala | 6 +- .../pipes/LetSelectOrSemiApplyPipeTest.scala | 4 +- .../pipes/LetSemiApplyPipeTest.scala | 4 +- .../interpreted/pipes/LimitPipeTest.scala | 4 +- .../pipes/NodeByIdSeekPipeTest.scala | 2 +- .../pipes/NodeByLabelScanPipeTest.scala | 8 +- .../NodeCountFromCountStorePipeTest.scala | 8 +- .../pipes/NodeHashJoinPipeTest.scala | 4 +- .../pipes/NodeIndexScanPipeTest.scala | 6 +- .../pipes/NodeIndexSeekPipeTest.scala | 6 +- .../pipes/NodeLeftOuterHashJoinPipeTest.scala | 2 +- .../NodeRightOuterHashJoinPipeTest.scala | 2 +- .../pipes/OptionalExpandAllPipeTest.scala | 4 +- .../pipes/OptionalExpandIntoPipeTest.scala | 4 +- .../interpreted/pipes/OptionalPipeTest.scala | 4 +- .../interpreted/pipes/PipeTestSupport.scala | 6 +- .../pipes/ProcedureCallPipeTest.scala | 4 +- .../pipes/ProduceResultsPipeTest.scala | 2 +- .../pipes/ProjectEndpointsPipeTest.scala | 2 +- .../PruningVarLengthExpandPipeTest.scala | 2 +- .../interpreted/pipes/QueryStateTest.scala | 2 +- ...ationshipCountFromCountStorePipeTest.scala | 10 +- .../pipes/RollUpApplyPipeTest.scala | 4 +- .../pipes/SelectOrSemiApplyPipeTest.scala | 4 +- .../interpreted/pipes/SemiApplyPipeTest.scala | 4 +- .../pipes/SetPropertyPipeTest.scala | 16 +- .../pipes/SingleShortestPathPipeTest.scala | 4 +- .../interpreted/pipes/SkipPipeTest.scala | 2 +- .../interpreted/pipes/SortPipeTest.scala | 4 +- .../pipes/Top1WithTiesPipeTest.scala | 4 +- .../interpreted/pipes/TopPipeTest.scala | 4 +- .../pipes/TriadicSelectionPipeTest.scala | 4 +- ...DirectedRelationshipByIdSeekPipeTest.scala | 2 +- .../interpreted/pipes/UnionIteratorTest.scala | 2 +- .../interpreted/pipes/UnwindPipeTest.scala | 4 +- .../pipes/ValueHashJoinPipeTest.scala | 4 +- .../pipes/VarLengthExpandPipeTest.scala | 6 +- .../pipes/aggregation/AvgFunctionTest.scala | 2 +- .../aggregation/CollectFunctionTest.scala | 2 +- .../pipes/aggregation/CountTest.scala | 2 +- .../pipes/aggregation/MaxFunctionTest.scala | 2 +- .../pipes/aggregation/MinFunctionTest.scala | 2 +- .../aggregation/PercentileFunctionsTest.scala | 2 +- .../pipes/aggregation/StdevFunctionTest.scala | 2 +- .../pipes/aggregation/SumFunctionTest.scala | 4 +- .../pipes/matching/HistoryTest.scala | 4 +- .../matching/PatternRelationshipTest.scala | 4 +- community/cypher/ir-3.5/LICENSES.txt | 6 + community/cypher/ir-3.5/NOTICE.txt | 6 + community/cypher/ir-3.5/pom.xml | 34 +- .../ir/v3_5/CreatesPropertyKeys.scala | 3 +- .../internal/ir/v3_5/MutatingPattern.scala | 2 +- .../ir/v3_5/PatternRelationship.scala | 2 +- .../internal/ir/v3_5/PeriodicCommit.scala | 2 +- .../internal/ir/v3_5/PlannerQuery.scala | 6 +- .../cypher/internal/ir/v3_5/Predicate.scala | 2 +- .../cypher/internal/ir/v3_5/QueryGraph.scala | 6 +- .../internal/ir/v3_5/QueryHorizon.scala | 6 +- .../internal/ir/v3_5/QueryShuffle.scala | 6 +- .../cypher/internal/ir/v3_5/Selections.scala | 2 +- .../ir/v3_5/ShortestPathPattern.scala | 2 +- .../cypher/internal/ir/v3_5/UpdateGraph.scala | 12 +- .../v3_5/helpers/ExpressionConverters.scala | 11 +- .../ir/v3_5/helpers/PatternConverters.scala | 4 +- .../internal/ir/v3_5/SelectivityTest.scala | 4 +- community/cypher/planner-spi-3.5/LICENSES.txt | 6 + community/cypher/planner-spi-3.5/NOTICE.txt | 6 + community/cypher/planner-spi-3.5/pom.xml | 6 +- .../planner/v3_5/spi/GraphStatistics.scala | 2 +- .../planner/v3_5/spi/IndexDescriptor.scala | 2 +- .../spi/InstrumentedGraphStatistics.scala | 2 +- .../planner/v3_5/spi/PlanContext.scala | 2 +- .../planner/v3_5/spi/PlannerName.scala | 2 +- .../planner/v3_5/spi/PlanningAttributes.scala | 4 +- community/cypher/pom.xml | 4 +- community/cypher/runtime-util/LICENSES.txt | 6 + community/cypher/runtime-util/NOTICE.txt | 6 + community/cypher/runtime-util/pom.xml | 12 +- .../org/neo4j/cypher/exceptionHandler.scala | 4 +- .../internal/runtime/ExecutionMode.scala | 2 +- .../internal/runtime/QueryContext.scala | 2 +- .../cypher/internal/runtime/Runtime.scala | 6 +- .../runtime/RuntimeJavaValueConverter.scala | 2 +- .../runtime/RuntimeScalaValueConverter.scala | 2 +- .../InternalPlanDescription.scala | 11 +- .../LogicalPlan2PlanDescription.scala | 8 +- .../PlanDescriptionArgumentSerializer.scala | 8 +- .../neo4j/cypher/GraphDatabaseFunSuite.scala | 2 +- .../cypher/GraphDatabaseTestSupport.scala | 2 +- .../internal/runtime/ArrayBackedMapTest.scala | 2 +- .../cypher/internal/runtime/CounterTest.scala | 2 +- .../runtime/CreateTempFileTestSupport.scala | 2 +- .../RuntimeJavaValueConverterTest.scala | 2 +- .../RuntimeScalaValueConverterTest.scala | 2 +- .../CompactedPlanDescriptionTest.scala | 2 +- .../InternalPlanDescriptionTest.scala | 4 +- .../LogicalPlan2PlanDescriptionTest.scala | 8 +- ...anDescriptionArgumentSerializerTests.scala | 10 +- .../planDescription/RenderSummaryTest.scala | 4 +- .../planDescription/RenderTreeTableTest.scala | 8 +- community/cypher/util-3.5/ASL-2-header.txt | 14 - community/cypher/util-3.5/LICENSES.txt | 291 ---- community/cypher/util-3.5/NOTICE.txt | 29 - community/cypher/util-3.5/pom.xml | 88 -- .../internal/util/v3_5/AssertionRunner.java | 56 - .../cypher/internal/util/v3_5/ASTNode.scala | 42 - .../internal/util/v3_5/AssertionUtils.scala | 29 - .../internal/util/v3_5/Cardinality.scala | 111 -- .../internal/util/v3_5/CypherException.scala | 210 --- .../cypher/internal/util/v3_5/Eagerly.scala | 44 - .../cypher/internal/util/v3_5/Foldable.scala | 244 ---- .../internal/util/v3_5/InputPosition.scala | 54 - .../cypher/internal/util/v3_5/NameId.scala | 32 - .../internal/util/v3_5/NonEmptyList.scala | 358 ----- .../util/v3_5/PrefixNameGenerator.scala | 45 - .../neo4j/cypher/internal/util/v3_5/Ref.scala | 37 - .../internal/util/v3_5/Rewritable.scala | 280 ---- .../internal/util/v3_5/Selectivity.scala | 45 - .../internal/util/v3_5/TaskCloser.scala | 58 - .../internal/util/v3_5/Unchangeable.scala | 46 - .../internal/util/v3_5/ZeroOneOrMany.scala | 31 - .../util/v3_5/attribution/Attribute.scala | 138 -- .../internal/util/v3_5/attribution/Ids.scala | 40 - .../cypher/internal/util/v3_5/package.scala | 22 - .../util/v3_5/spi/MapToPublicExceptions.scala | 85 -- .../internal/util/v3_5/symbols/AnyType.scala | 31 - .../util/v3_5/symbols/BooleanType.scala | 27 - .../util/v3_5/symbols/CypherType.scala | 65 - .../util/v3_5/symbols/FloatType.scala | 27 - .../util/v3_5/symbols/GeometryType.scala | 28 - .../util/v3_5/symbols/GraphRefType.scala | 27 - .../util/v3_5/symbols/IntegerType.scala | 28 - .../internal/util/v3_5/symbols/ListType.scala | 68 - .../internal/util/v3_5/symbols/MapType.scala | 27 - .../internal/util/v3_5/symbols/NodeType.scala | 27 - .../util/v3_5/symbols/NumberType.scala | 28 - .../internal/util/v3_5/symbols/PathType.scala | 27 - .../util/v3_5/symbols/PointType.scala | 27 - .../util/v3_5/symbols/RelationshipType.scala | 27 - .../util/v3_5/symbols/StringType.scala | 27 - .../util/v3_5/symbols/TemporalTypes.scala | 57 - .../util/v3_5/symbols/TypeRange.scala | 111 -- .../internal/util/v3_5/symbols/TypeSpec.scala | 232 --- .../internal/util/v3_5/symbols/package.scala | 44 - .../util/v3_5/symbols/type_system.txt | 31 - .../internal/util/v3_5/DummyPosition.scala | 21 - .../internal/util/v3_5/EagerlyTest.scala | 67 - .../internal/util/v3_5/RewritableTest.scala | 219 --- .../internal/util/v3_5/TaskCloserTest.scala | 93 -- .../util/v3_5/ZeroOneOrManyTest.scala | 34 - .../util/v3_5/attribution/AttributeTest.scala | 83 -- .../v3_5/test_helpers/CypherFunSuite.scala | 63 - .../v3_5/test_helpers/CypherTestSupport.scala | 23 - .../v3_5/test_helpers/IgnoreAllTests.scala | 34 - .../v3_5/test_helpers/WindowsStringSafe.scala | 28 - community/neo4j-community/LICENSES.txt | 6 + community/neo4j-community/NOTICE.txt | 6 + community/neo4j-harness/LICENSES.txt | 6 + community/neo4j-harness/NOTICE.txt | 6 + community/neo4j/LICENSES.txt | 6 + community/neo4j/NOTICE.txt | 6 + community/server-plugin-test/LICENSES.txt | 6 + community/server-plugin-test/NOTICE.txt | 6 + community/server/LICENSES.txt | 6 + community/server/NOTICE.txt | 6 + .../cypher/acceptance-spec-suite/LICENSES.txt | 6 + .../cypher/acceptance-spec-suite/NOTICE.txt | 6 + .../cypher/acceptance-spec-suite/pom.xml | 13 +- ...ianProductNotificationAcceptanceTest.scala | 11 +- ...ositeNodeKeyConstraintAcceptanceTest.scala | 2 +- .../acceptance/CypherComparisonSupport.scala | 4 +- .../cypher/acceptance/DebugToStringTest.scala | 2 +- .../DumpToStringAcceptanceTest.scala | 2 +- .../acceptance/ExecutionEngineTest.scala | 2 +- .../cypher/acceptance/GrammarStressIT.scala | 2 +- .../acceptance/LoadCsvAcceptanceTest.scala | 2 +- .../LoadCsvAcceptanceUserAgentTest.scala | 2 +- .../acceptance/Neo4jValueComparisonTest.scala | 2 +- .../NotificationAcceptanceTest.scala | 2 +- ...pressionImplementationAcceptanceTest.scala | 2 +- .../PeriodicCommitAcceptanceTest.scala | 2 +- .../acceptance/PreParsingAcceptanceTest.scala | 2 +- .../acceptance/ProfilerAcceptanceTest.scala | 4 +- .../QueryPlanCompactionAcceptanceTest.scala | 2 +- .../SemanticCreateAcceptanceTest.scala | 2 +- .../SemanticDeleteAcceptanceTest.scala | 2 +- .../SemanticErrorAcceptanceTest.scala | 2 +- .../SemanticMergeAcceptanceTest.scala | 2 +- ...athExhaustiveForbiddenAcceptanceTest.scala | 2 +- .../ShortestPathLongerAcceptanceTest.scala | 2 +- .../acceptance/TimeZoneAcceptanceTest.scala | 2 +- .../acceptance/VarLengthPlanningTest.scala | 2 +- .../compatibility-spec-suite/LICENSES.txt | 6 + .../compatibility-spec-suite/NOTICE.txt | 6 + enterprise/cypher/cypher/LICENSES.txt | 6 + enterprise/cypher/cypher/NOTICE.txt | 6 + enterprise/cypher/cypher/pom.xml | 12 +- .../codegen/QueryExecutionTracer.java | 2 +- .../codegen/profiling/ProfilingTracer.java | 2 +- .../internal/BuildSlottedExecutionPlan.scala | 10 +- .../BuildVectorizedExecutionPlan.scala | 11 +- .../cypher/internal/DebugPrettyPrinter.scala | 4 +- .../internal/EnterpriseRuntimeBuilder.scala | 5 +- .../compiled/BuildCompiledExecutionPlan.scala | 8 +- .../compiled/CompiledExecutionResult.scala | 2 +- .../compiled/CompiledRuntimeBuilder.scala | 5 +- .../compiled/EnterpriseRuntimeContext.scala | 6 +- .../compiled/ExecutionPlanBuilder.scala | 4 +- .../codegen/CodeGenConfiguration.scala | 2 +- .../compiled/codegen/CodeGenContext.scala | 4 +- .../compiled/codegen/CodeGenerator.scala | 8 +- .../codegen/LogicalPlanConverter.scala | 48 +- .../ir/ExpandAllLoopDataGenerator.scala | 2 +- .../ir/ExpandIntoLoopDataGenerator.scala | 2 +- .../ir/UnwindPrimitiveCollection.scala | 2 +- .../ir/aggregation/AggregationConverter.scala | 4 +- .../codegen/ir/expressions/Addition.scala | 2 +- .../ir/expressions/AnyProjection.scala | 2 +- .../ir/expressions/BinaryOperator.scala | 4 +- .../codegen/ir/expressions/CodeGenType.scala | 2 +- .../codegen/ir/expressions/Equals.scala | 6 +- .../ir/expressions/ExpressionConverter.scala | 4 +- .../codegen/ir/expressions/HasLabel.scala | 2 +- .../codegen/ir/expressions/IdOf.scala | 2 +- .../codegen/ir/expressions/ListLiteral.scala | 4 +- .../codegen/ir/expressions/LoadVariable.scala | 2 +- .../codegen/ir/expressions/Modulo.scala | 2 +- .../codegen/ir/expressions/MyMap.scala | 2 +- .../ir/expressions/NodeProjection.scala | 2 +- .../compiled/codegen/ir/expressions/Not.scala | 2 +- .../compiled/codegen/ir/expressions/Or.scala | 2 +- .../expressions/RelationshipProjection.scala | 2 +- .../codegen/ir/expressions/TypeOf.scala | 2 +- .../ir/functions/CodeGenFunction1.scala | 2 +- .../ir/functions/functionConverter.scala | 4 +- .../compiled/codegen/spi/CodeStructure.scala | 2 +- .../codegen/spi/MethodStructure.scala | 2 +- .../compiled/helpers/LiteralTypeSupport.scala | 2 +- .../internal/spi/codegen/AuxGenerator.scala | 4 +- .../codegen/GeneratedMethodStructure.scala | 10 +- .../spi/codegen/GeneratedQueryStructure.scala | 6 +- .../cypher/internal/spi/codegen/Methods.scala | 2 +- .../internal/spi/codegen/Templates.scala | 4 +- .../neo4j/cypher/CloseTransactionTest.scala | 2 +- .../org/neo4j/cypher/ExecutionEngineIT.scala | 2 +- .../neo4j/cypher/RootPlanAcceptanceTest.scala | 2 +- .../profiling/ProfilingTracerTest.scala | 4 +- .../internal/queryReduction/BTTest.scala | 2 +- .../CypherReductionSupport.scala | 18 +- .../CypherReductionSupportTest.scala | 4 +- .../internal/queryReduction/DDminTest.scala | 2 +- .../queryReduction/ReductionTestHelper.scala | 2 +- .../queryReduction/StatementGTRInput.scala | 2 +- .../StatementLevelBTInput.scala | 4 +- .../StatementLevelDDInput.scala | 4 +- .../queryReduction/ast/ASTNodeHelper.scala | 2 +- .../queryReduction/ast/copyNodeWith.scala | 6 +- .../queryReduction/ast/domainsOf.scala | 6 +- .../queryReduction/ast/getChildren.scala | 6 +- .../codegen/CompiledExecutionResultTest.scala | 4 +- .../CompiledRuntimeContextHelper.scala | 8 +- .../GeneratedMethodStructureTest.scala | 10 +- .../spi/codegen/SaveGeneratedSource.scala | 2 +- .../CodeGenExpressionTypesTest.scala | 4 +- .../ir/BuildProbeTableInstructionsTest.scala | 6 +- .../spi/codegen/ir/CodeGenSugar.scala | 6 +- .../codegen/ir/CompiledProfilingTest.scala | 6 +- enterprise/cypher/morsel-runtime/LICENSES.txt | 6 + enterprise/cypher/morsel-runtime/NOTICE.txt | 6 + enterprise/cypher/morsel-runtime/pom.xml | 12 +- .../internal/runtime/vectorized/Message.scala | 2 +- .../runtime/vectorized/PipelineBuilder.scala | 4 +- .../vectorized/dispatcher/Dispatcher.scala | 2 +- .../dispatcher/ParallelDispatcher.scala | 2 +- .../dispatcher/SingleThreadedExecutor.scala | 2 +- .../AggregationExpressionOperator.scala | 4 +- .../expressions/AvgOperatorExpression.scala | 2 +- .../CollectOperatorExpression.scala | 2 +- .../expressions/CountOperatorExpression.scala | 2 +- .../MinOrMaxOperatorExpression.scala | 2 +- .../MorselExpressionConverters.scala | 9 +- .../operators/ArgumentOperator.scala | 2 +- .../operators/ExpandAllOperator.scala | 4 +- .../operators/NodeIndexSeekOperator.scala | 2 +- .../operators/ProduceResultOperator.scala | 2 +- .../AvgOperatorExpressionTest.scala | 2 +- ...regationMapperOperatorNoGroupingTest.scala | 4 +- .../AggregationMapperOperatorTest.scala | 4 +- ...egationReducerOperatorNoGroupingTest.scala | 4 +- .../AggregationReducerOperatorTest.scala | 4 +- .../operators/MergeSortOperatorTest.scala | 4 +- .../operators/PreSortOperatorTest.scala | 4 +- .../cypher/physical-planning/LICENSES.txt | 6 + .../cypher/physical-planning/NOTICE.txt | 6 + enterprise/cypher/physical-planning/pom.xml | 12 +- .../runtime/PhysicalPlanningAttributes.scala | 2 +- .../compatibility/v3_5/runtime/Slot.scala | 2 +- .../v3_5/runtime/SlotAllocation.scala | 14 +- .../v3_5/runtime/SlotConfiguration.scala | 4 +- .../v3_5/runtime/SlottedRewriter.scala | 14 +- .../v3_5/runtime/ast/GetDegreePrimitive.scala | 2 +- .../v3_5/runtime/ast/NodeProperty.scala | 2 +- .../v3_5/runtime/ast/NullCheck.scala | 2 +- .../v3_5/runtime/ast/PrimitiveEquals.scala | 2 +- .../runtime/ast/RelationshipProperty.scala | 2 +- .../v3_5/runtime/ast/RuntimeExpression.scala | 8 +- .../v3_5/runtime/ast/RuntimeProperty.scala | 10 +- .../v3_5/runtime/ast/RuntimeVariable.scala | 8 +- .../runtime/SlotAllocationArgumentsTest.scala | 6 +- .../v3_4/runtime/SlotAllocationTest.scala | 12 +- .../v3_4/runtime/SlotConfigurationTest.scala | 6 +- .../v3_4/runtime/SlottedRewriterTest.scala | 12 +- enterprise/cypher/pom.xml | 1 + .../cypher/slotted-runtime/LICENSES.txt | 6 + enterprise/cypher/slotted-runtime/NOTICE.txt | 6 + enterprise/cypher/slotted-runtime/pom.xml | 12 +- .../slotted/ArrayResultExecutionContext.scala | 2 +- .../slotted/SlottedExecutionContext.scala | 6 +- .../runtime/slotted/SlottedPipeBuilder.scala | 14 +- .../expressions/GetDegreePrimitive.scala | 2 +- .../SlottedExpressionConverters.scala | 4 +- .../helpers/SlottedPipeBuilderUtils.scala | 4 +- .../pipes/AllNodesScanSlottedPipe.scala | 2 +- .../slotted/pipes/ApplySlottedPipe.scala | 2 +- .../slotted/pipes/ArgumentSlottedPipe.scala | 2 +- .../pipes/BaseRelationshipSlottedPipe.scala | 4 +- .../pipes/CartesianProductSlottedPipe.scala | 2 +- .../pipes/ConditionalApplySlottedPipe.scala | 2 +- .../slotted/pipes/CreateNodeSlottedPipe.scala | 4 +- .../slotted/pipes/DistinctSlottedPipe.scala | 2 +- .../pipes/DistinctSlottedPrimitivePipe.scala | 2 +- .../DistinctSlottedSinglePrimitivePipe.scala | 2 +- .../pipes/EagerAggregationSlottedPipe.scala | 2 +- ...ggregationWithoutGroupingSlottedPipe.scala | 2 +- .../slotted/pipes/EagerSlottedPipe.scala | 2 +- .../slotted/pipes/ExpandAllSlottedPipe.scala | 6 +- .../slotted/pipes/ExpandIntoSlottedPipe.scala | 4 +- .../slotted/pipes/ForeachSlottedPipe.scala | 2 +- .../pipes/NodeHashJoinSlottedPipe.scala | 2 +- .../pipes/NodeIndexScanSlottedPipe.scala | 4 +- .../pipes/NodeIndexSeekSlottedPipe.scala | 4 +- .../pipes/NodesByLabelScanSlottedPipe.scala | 2 +- .../pipes/OptionalExpandAllSlottedPipe.scala | 6 +- .../pipes/OptionalExpandIntoSlottedPipe.scala | 4 +- .../slotted/pipes/OptionalSlottedPipe.scala | 2 +- .../pipes/PrimitiveCachingExpandInto.scala | 4 +- .../pipes/ProduceResultSlottedPipe.scala | 2 +- .../slotted/pipes/ProjectionSlottedPipe.scala | 2 +- .../pipes/RollUpApplySlottedPipe.scala | 2 +- .../slotted/pipes/SortSlottedPipe.scala | 2 +- .../slotted/pipes/TopSlottedPipe.scala | 2 +- .../slotted/pipes/UnionSlottedPipe.scala | 2 +- .../slotted/pipes/UnwindSlottedPipe.scala | 2 +- .../pipes/ValueHashJoinSlottedPipe.scala | 2 +- .../pipes/VarLengthExpandSlottedPipe.scala | 6 +- .../PrimitiveExecutionContextTest.scala | 4 +- .../slotted/SlottedPipeBuilderTest.scala | 10 +- .../helpers/SlottedPipeBuilderUtilsTest.scala | 8 +- .../slotted/pipes/FakeSlottedPipe.scala | 2 +- .../pipes/HashJoinSlottedPipeTestHelper.scala | 2 +- .../pipes/NodeHashJoinSlottedPipeTest.scala | 4 +- .../ProduceResultSlottedPipeStressTest.scala | 6 +- .../pipes/RollUpApplySlottedPipeTest.scala | 4 +- .../pipes/Top1WithTiesSlottedPipeTest.scala | 2 +- .../slotted/pipes/TopSlottedPipeTest.scala | 4 +- .../slotted/pipes/UnionSlottedPipeTest.scala | 4 +- .../slotted/pipes/UnwindSlottedPipeTest.scala | 4 +- .../pipes/ValueHashJoinSlottedPipeTest.scala | 4 +- .../cypher/spec-suite-tools/LICENSES.txt | 6 + enterprise/cypher/spec-suite-tools/NOTICE.txt | 6 + .../features/Neo4jProcedureAdapter.scala | 2 +- .../cypher/features/ProcedureSignature.scala | 2 +- .../features/ProcedureSignatureParser.scala | 6 +- enterprise/kernel/pom.xml | 15 +- .../EnterpriseGraphDatabaseTestSupport.scala | 2 +- enterprise/neo4j-enterprise/LICENSES.txt | 6 + enterprise/neo4j-enterprise/NOTICE.txt | 6 + .../neo4j-harness-enterprise/LICENSES.txt | 6 + .../neo4j-harness-enterprise/NOTICE.txt | 6 + enterprise/server-enterprise/LICENSES.txt | 6 + enterprise/server-enterprise/NOTICE.txt | 6 + .../distribution/text/community/LICENSES.txt | 6 + .../distribution/text/community/NOTICE.txt | 6 + 1426 files changed, 2564 insertions(+), 32132 deletions(-) delete mode 100644 community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/Tapper.scala delete mode 100644 community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/IdentityMapTest.scala delete mode 100644 community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/InputPositionTest.scala delete mode 100644 community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ScopeTest.scala delete mode 100644 community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ScopeTreeTest.scala delete mode 100644 community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ScopeTreeVerificationTest.scala delete mode 100644 community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/SemanticCheckableTest.scala delete mode 100644 community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/SemanticStateTest.scala delete mode 100644 community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/ScopeTestHelper.scala delete mode 100644 community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/SemanticTableHelper.scala delete mode 100644 community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/TreeZipperTest.scala delete mode 100644 community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/parser/ParserFixture.scala delete mode 100644 community/cypher/expressions-3.5/ASL-2-header.txt delete mode 100644 community/cypher/expressions-3.5/LICENSES.txt delete mode 100644 community/cypher/expressions-3.5/NOTICE.txt delete mode 100644 community/cypher/expressions-3.5/pom.xml delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/AndedPropertyInequalities.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/ArithmeticExpressions.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/CaseExpression.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/CoerceTo.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/ConstantExpression.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/CountStar.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Expression.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/FunctionInvocation.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/GetDegree.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/HasLabels.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/IsAggregate.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/IterableExpressions.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/ListLiteral.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Literal.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/LogicalProperty.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/LogicalVariable.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/MapExpression.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/MapProjection.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/NameToken.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/OperatorExpression.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Parameter.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/PathExpression.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Pattern.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/PatternExpression.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/PredicateExpressions.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Property.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Range.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/ScopeExpression.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/SemanticDirection.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/ShortestPathExpression.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/SymbolicName.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/TypeSignature.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/TypeSignatures.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Variable.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/containsAggregate.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Abs.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Acos.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Asin.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Atan.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Atan2.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Avg.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Ceil.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Coalesce.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Collect.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Cos.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Cot.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Count.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Degrees.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Distance.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/E.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/EndNode.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Exists.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Exp.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Floor.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Function.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Haversin.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Head.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Id.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Keys.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/LTrim.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Labels.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Last.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Left.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Length.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Log.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Log10.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Max.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Min.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Nodes.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/PercentileCont.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/PercentileDisc.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Pi.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Point.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Properties.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/RTrim.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Radians.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Rand.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Range.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Reduce.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Relationships.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Replace.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Reverse.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Right.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Round.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Sign.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Sin.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Size.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Split.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Sqrt.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/StartNode.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/StdDev.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/StdDevP.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Substring.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Sum.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Tail.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Tan.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Timestamp.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToBoolean.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToFloat.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToInteger.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToLower.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToString.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToUpper.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Trim.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Type.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/UnresolvedFunction.scala delete mode 100644 community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/UserDefinedFunctionInvocation.scala delete mode 100644 community/cypher/expressions-3.5/src/test/scala/org/neo4j/cypher/internal/v3_5/expressions/DummyExpression.scala delete mode 100644 community/cypher/frontend-3.5/ASL-2-header.txt delete mode 100644 community/cypher/frontend-3.5/LICENSES.txt delete mode 100644 community/cypher/frontend-3.5/NOTICE.txt delete mode 100644 community/cypher/frontend-3.5/pom.xml delete mode 100644 community/cypher/frontend-3.5/src/main/java/org/neo4j/cypher/internal/frontend/v3_5/phases/CompilationPhaseTracer.java delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/AstRewritingMonitor.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/IdentityMap.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/PlannerName.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ScopeTreeVerifier.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ASTAnnotationMap.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ASTSlicingPhrase.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Clause.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Command.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/GraphRef.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/GraphReturnItems.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/GraphUrl.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Hint.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Limit.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/MergeAction.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Order.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/PeriodicCommitHint.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ProcedureResult.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ProcedureResultItem.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Query.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/RemoveItem.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ReturnItem.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/SetItem.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/SingleGraphAs.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Skip.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Statement.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Where.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/StatementCondition.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/aggregationsAreIsolated.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/collectNodesOfType.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/containsNoMatchingNodes.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/containsNoNodesOfType.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/containsNoReturnAll.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noDuplicatesInReturnItems.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noReferenceEqualityAmongVariables.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noUnnamedGraphs.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noUnnamedPatternElementsInGraphOf.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noUnnamedPatternElementsInMatch.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noUnnamedPatternElementsInPatternComprehension.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/normalizedEqualsArguments.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/orderByOnlyOnVariables.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/connectedComponents.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/hasAggregateButIsNotAggregate.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/ASTRewriter.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/CNFNormalizer.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/LabelPredicateNormalizer.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/MatchPredicateNormalization.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/MatchPredicateNormalizer.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/MatchPredicateNormalizerChain.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/Namespacer.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/PatternExpressionPatternElementNamer.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/PropertyPredicateNormalizer.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/ReturnItemSafeTopDownRewriter.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/StatementRewriter.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/addUniquenessPredicates.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/collapseMultipleInPredicates.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/copyVariables.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/createGraphIntroducesHorizon.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/desugarMapProjection.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/expandCallWhere.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/expandStar.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/foldConstants.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/inlineNamedPathsInPatternComprehensions.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/isolateAggregation.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/literalReplacement.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/mergeInPredicates.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/nameAllPatternElements.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/nameGraphOfPatternElements.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/nameMatchPatternElements.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/namePatternComprehensionPatternElements.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/nameUpdatingClauses.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeArgumentOrder.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeComparisons.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeGraphReturnItems.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeMatchPredicates.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeNotEquals.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeReturnClauses.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeWithClauses.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/projectFreshSortExpressions.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/projectNamedPaths.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/recordScopes.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/repeatWithSizeLimit.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/replaceAliasedFunctionInvocations.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/replaceLiteralDynamicPropertyLookups.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/rewriteEqualityToInPredicate.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/transitiveClosure.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/PartialFunctionSupport.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/SeqCombiner.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/StringHelper.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/TreeZipper.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/calculateUsingGetDegree.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/fixedPoint.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/package.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterCondition.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterStep.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterStepSequencer.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterTask.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterTaskBuilder.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterTaskProcessor.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/notification/InternalNotification.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/package.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Base.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/BufferPosition.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Clauses.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Command.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/CypherParser.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Expressions.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Graphs.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/InvalidInputErrorFormatter.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/LikePatternParser.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Literals.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Patterns.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ProcedureCalls.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Query.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/StartPoints.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Statement.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Strings.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/convertLikePatternToRegex.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/matchers/IdentifierPartMatcher.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/matchers/IdentifierStartMatcher.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/matchers/ScalaCharMatcher.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/matchers/WhitespaceCharMatcher.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/package.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/AstRewriting.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/BaseContext.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/BaseState.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/CompilationPhases.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/Condition.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/InternalNotificationLogger.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/LateAstRewriting.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/Monitors.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/Parsing.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/Phase.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/PreparatoryRewriting.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/SemanticAnalysis.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/SyntaxDeprecationWarnings.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/Transformer.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/prettifier/ExpressionStringifier.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/prettifier/Prettifier.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticAnalysisTooling.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticCheck.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticChecker.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticError.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticExpressionCheck.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticFeature.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticFunctionCheck.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticPatternCheck.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticState.scala delete mode 100644 community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticTable.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/FoldableTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/RepeatTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/SemanticAnalysisTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ASTNodeTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/AstConstructionTestSupport.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ConnectedComponentsTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ConstantExpressionTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ContainsAggregateTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ExpressionCallTypeCheckerTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ExpressionTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/FindDuplicateRelationshipsTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/FunctionNameTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/GraphReturnItemsTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/IsAggregateTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/LoadCSVTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/MapProjectionTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/MultipleGraphClauseSemanticCheckingTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/PeriodicCommitHintTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ProjectionClauseTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ReturnItemsTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/SetClauseTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/SingleGraphTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/StatementReturnColumnsTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/TestExpression.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/NonEmptyListTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/StatementHelper.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/StringHelperTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterStepSequencerTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/BaseRulesTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ComparisonTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/FunctionInvocationParserTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/GraphReturnItemsParserTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/GraphsParserTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/LiteralsTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/MultipleGraphClausesParsingTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/MultipleGraphsParserTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ParserAstTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ParserTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ProcedureCallParserTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ProjectionClauseParserTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/prettifier/ExpressionStringifierTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/prettifier/PrettifierTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/AddTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/AndTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ContainerIndexTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/DivideTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/FilterExpressionTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/FilteringExpressionTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/GreaterThanOrEqualTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/GreaterThanTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/HexIntegerLiteralTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/InfixExpressionTestBase.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/LessThanOrEqualTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/LessThanTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ListComprehensionTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ListSliceTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/LiteralTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ModuloTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/MultiplyTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/OrTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/PatternComprehensionTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/PowTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/PropertyTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ReduceExpressionTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticAnalysisToolingTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticCaseExpressionTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticExtractExpressionTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticFunSuite.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ShortestPathExpressionTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SubtractTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/VariableTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/XorTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/AbsTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/DistanceTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/FunctionTestBase.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/LabelsTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/PercentileContTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/PercentileDiscTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/PointTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/ReverseTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/SplitTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/ToFloatTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/ToIntegerTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/ToStringTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/symbols/CypherTypeTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/symbols/TypeRangeTest.scala delete mode 100644 community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/symbols/TypeSpecTest.scala delete mode 100644 community/cypher/util-3.5/ASL-2-header.txt delete mode 100644 community/cypher/util-3.5/LICENSES.txt delete mode 100644 community/cypher/util-3.5/NOTICE.txt delete mode 100644 community/cypher/util-3.5/pom.xml delete mode 100644 community/cypher/util-3.5/src/main/java/org/neo4j/cypher/internal/util/v3_5/AssertionRunner.java delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/ASTNode.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/AssertionUtils.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Cardinality.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/CypherException.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Eagerly.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Foldable.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/InputPosition.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/NameId.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/NonEmptyList.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/PrefixNameGenerator.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Ref.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Rewritable.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Selectivity.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/TaskCloser.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Unchangeable.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/ZeroOneOrMany.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/attribution/Attribute.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/attribution/Ids.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/package.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/spi/MapToPublicExceptions.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/AnyType.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/BooleanType.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/CypherType.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/FloatType.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/GeometryType.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/GraphRefType.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/IntegerType.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/ListType.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/MapType.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/NodeType.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/NumberType.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/PathType.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/PointType.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/RelationshipType.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/StringType.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/TemporalTypes.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/TypeRange.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/TypeSpec.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/package.scala delete mode 100644 community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/type_system.txt delete mode 100644 community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/DummyPosition.scala delete mode 100644 community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/EagerlyTest.scala delete mode 100644 community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/RewritableTest.scala delete mode 100644 community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/TaskCloserTest.scala delete mode 100644 community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/ZeroOneOrManyTest.scala delete mode 100644 community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/attribution/AttributeTest.scala delete mode 100644 community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/test_helpers/CypherFunSuite.scala delete mode 100644 community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/test_helpers/CypherTestSupport.scala delete mode 100644 community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/test_helpers/IgnoreAllTests.scala delete mode 100644 community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/test_helpers/WindowsStringSafe.scala diff --git a/community/bolt/LICENSES.txt b/community/bolt/LICENSES.txt index 205ba73deb76a..2286a00132871 100644 --- a/community/bolt/LICENSES.txt +++ b/community/bolt/LICENSES.txt @@ -21,6 +21,12 @@ Apache Software License, Version 2.0 Netty/All-in-One Objenesis opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala WMI4Java diff --git a/community/bolt/NOTICE.txt b/community/bolt/NOTICE.txt index 9935a8f6ee3c4..1b5078a33fc5f 100644 --- a/community/bolt/NOTICE.txt +++ b/community/bolt/NOTICE.txt @@ -44,6 +44,12 @@ Apache Software License, Version 2.0 Netty/All-in-One Objenesis opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala WMI4Java diff --git a/community/cypher/cypher-logical-plans-3.5/LICENSES.txt b/community/cypher/cypher-logical-plans-3.5/LICENSES.txt index ce26bb13a205e..d0efacac18054 100644 --- a/community/cypher/cypher-logical-plans-3.5/LICENSES.txt +++ b/community/cypher/cypher-logical-plans-3.5/LICENSES.txt @@ -5,6 +5,12 @@ libraries. For an overview of the licenses see the NOTICE.txt file. ------------------------------------------------------------------------------ Apache Software License, Version 2.0 Apache Commons Lang + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala ------------------------------------------------------------------------------ diff --git a/community/cypher/cypher-logical-plans-3.5/NOTICE.txt b/community/cypher/cypher-logical-plans-3.5/NOTICE.txt index e07e0061191f2..d70842ac67895 100644 --- a/community/cypher/cypher-logical-plans-3.5/NOTICE.txt +++ b/community/cypher/cypher-logical-plans-3.5/NOTICE.txt @@ -28,6 +28,12 @@ Third-party licenses Apache Software License, Version 2.0 Apache Commons Lang + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala diff --git a/community/cypher/cypher-logical-plans-3.5/pom.xml b/community/cypher/cypher-logical-plans-3.5/pom.xml index 731635b8e4b55..a43e661fc651e 100644 --- a/community/cypher/cypher-logical-plans-3.5/pom.xml +++ b/community/cypher/cypher-logical-plans-3.5/pom.xml @@ -67,12 +67,6 @@ ${project.version} - - org.neo4j - openCypher-frontend-1 - ${project.version} - - org.neo4j neo4j-cypher-ir-3.5 @@ -82,17 +76,9 @@ - org.neo4j - openCypher-frontend-1 - ${project.version} - test-jar - test - - - - org.neo4j - neo4j-cypher-util-3.5 - ${project.version} + org.opencypher + util-9.0 + 1.0.0 test-jar test diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ActiveRead.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ActiveRead.scala index 99eaa6d5f1f7f..3652e131c55b9 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ActiveRead.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ActiveRead.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * Change the reads of all source plans to target the active tx-state instead of the stable. This is used for MERGE diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Aggregation.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Aggregation.scala index 52d0fe82bb855..4ed0223b7c26b 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Aggregation.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Aggregation.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.expressions.Expression +import org.opencypher.v9_0.util.attribution.IdGen /** * Aggregation is a more advanced version of Distinct, where source rows are grouped by the diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/AllNodesScan.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/AllNodesScan.scala index 3860fe3e51206..dc08c290c8d79 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/AllNodesScan.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/AllNodesScan.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * Produce one row for every node in the graph. Each row contains the contents of argument, and diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/AntiConditionalApply.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/AntiConditionalApply.scala index 840952877196c..d354483de5031 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/AntiConditionalApply.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/AntiConditionalApply.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * AntiConditionalApply works like ConditionalApply, but with reversed condition. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Apply.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Apply.scala index 180bc1956c984..d5011217b2cec 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Apply.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Apply.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * For every row in left, set that row as the argument, and produce all rows from right diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Argument.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Argument.scala index bcdaff10e5ad8..c9d7eb9826723 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Argument.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Argument.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.{IdGen, SameId} +import org.opencypher.v9_0.util.attribution.{IdGen, SameId} /** * Produce a single row with the contents of argument diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/AssertSameNode.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/AssertSameNode.scala index df56404dd6d13..fccd1eac66623 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/AssertSameNode.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/AssertSameNode.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * For every row in left, assert that all rows in right produce the same value diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/CartesianProduct.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/CartesianProduct.scala index 63ffaf7f17ef6..ceff4e69c3ede 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/CartesianProduct.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/CartesianProduct.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * Cartesian Product diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ConditionalApply.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ConditionalApply.scala index b0a5098cde301..79fd2ce0cbf70 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ConditionalApply.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ConditionalApply.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * This is a variation of apply, which only executes 'right' if all variables in 'items' != NO_VALUE. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/CreateNode.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/CreateNode.scala index b0d96f09e623b..a9970c1deb0f6 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/CreateNode.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/CreateNode.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, LabelName} +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions.{Expression, LabelName} /** * For each input row, create a new node with the provided labels and properties, diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/CreateRelationship.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/CreateRelationship.scala index 3bed51513d06e..fc5f94abb65c8 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/CreateRelationship.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/CreateRelationship.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, RelTypeName} +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions.{Expression, RelTypeName} /** * For each input row, create a new relationship with the provided type and properties, diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DeleteExpression.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DeleteExpression.scala index 1299ce35b57b9..ef6f1c78c919b 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DeleteExpression.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DeleteExpression.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.expressions.Expression import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * For each input row, delete the entity specified by 'expression'. Entity can be a node, relationship or path. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DeleteNode.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DeleteNode.scala index f0cb20953a874..68e4320711d6f 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DeleteNode.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DeleteNode.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.expressions.Expression import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * For each input row, delete the node specified by 'expression' from the graph. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DeletePath.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DeletePath.scala index 6cb494dd15247..c56da516573a2 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DeletePath.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DeletePath.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.expressions.Expression import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * For each input row, delete the path specified by 'expression' from the graph. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DeleteRelationship.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DeleteRelationship.scala index 99243aaab5d31..7410aa30efbd7 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DeleteRelationship.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DeleteRelationship.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.expressions.Expression import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * For each input row, delete the relationship specified by 'expression' from the graph. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DetachDeleteExpression.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DetachDeleteExpression.scala index d41e1f853166c..5897e05f972c6 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DetachDeleteExpression.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DetachDeleteExpression.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.expressions.Expression import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * For each input row, delete the entity specified by 'expression' from the graph. If the entity is a diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DetachDeleteNode.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DetachDeleteNode.scala index 85ffb13757bf1..33f0e53a78014 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DetachDeleteNode.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DetachDeleteNode.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.expressions.Expression import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * For each input row, delete the node specified by 'expression' and all its relationships from the graph. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DetachDeletePath.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DetachDeletePath.scala index da303c51a7cb4..d273c34a033de 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DetachDeletePath.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DetachDeletePath.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.expressions.Expression import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * For each input row, delete the path specified by 'expression' from the graph. All nodes in the path and all their diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DirectedRelationshipByIdSeek.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DirectedRelationshipByIdSeek.scala index cf0b5ac415a61..cd640edfb9cd0 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DirectedRelationshipByIdSeek.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DirectedRelationshipByIdSeek.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * For each relationship id in 'relIds', fetch the corresponding relationship. For each relationship, diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Distinct.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Distinct.scala index 9c119353ae070..ba10e369a7fbc 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Distinct.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Distinct.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.expressions.Expression +import org.opencypher.v9_0.util.attribution.IdGen /** * Distinct produces source rows without changing them, but omitting rows diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DropResult.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DropResult.scala index 710d366281552..938caeca1e187 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DropResult.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/DropResult.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /* * Produce zero rows without even using source. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Eager.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Eager.scala index 77ff693092628..5bfa40509afdf 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Eager.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Eager.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * Consumes and buffers all source rows, marks the transaction as stable, and then produces all rows. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/EmptyResult.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/EmptyResult.scala index 0c11e2e20714d..987b65187654f 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/EmptyResult.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/EmptyResult.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /* * Produce zero rows, regardless of source. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ErrorPlan.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ErrorPlan.scala index 521cca3264d12..4441add51edd0 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ErrorPlan.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ErrorPlan.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * Throws exception if evaluated. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Expand.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Expand.scala index a2d4a397dfd8d..304e429439bfc 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Expand.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Expand.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.ir.v3_5.VarPatternLength -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions._ /** * For every source row, traverse all the relationships of 'from' which fulfill the diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/FindShortestPaths.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/FindShortestPaths.scala index e7ac77796cc8d..75002abdbe0fc 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/FindShortestPaths.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/FindShortestPaths.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.expressions.Expression import org.neo4j.cypher.internal.ir.v3_5.ShortestPathPattern -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * Find the shortest paths between two nodes, as specified by 'shortestPath'. For each shortest path found produce a diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ForeachApply.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ForeachApply.scala index af0d2403f0738..e3cce679d3e44 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ForeachApply.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ForeachApply.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.expressions.Expression +import org.opencypher.v9_0.util.attribution.IdGen /** * ForeachApply is a side-effect type apply, which operates on a list value. Each left row is used to compute a diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LeftOuterHashJoin.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LeftOuterHashJoin.scala index 895ae905878b6..72cf0f416bf4b 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LeftOuterHashJoin.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LeftOuterHashJoin.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * Variant of NodeHashJoin. Also builds a hash table using 'left' and produces merged left and right rows using this diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LetSelectOrSemiApply.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LetSelectOrSemiApply.scala index 2088f86e5c1ce..144bbe3501ce6 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LetSelectOrSemiApply.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LetSelectOrSemiApply.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.expressions.Expression +import org.opencypher.v9_0.util.attribution.IdGen /** * Like LetSemiApply, but with a precondition 'expr'. If 'expr' is true, 'idName' will to set to true without diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LetSemiApply.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LetSemiApply.scala index 0b1ca59598372..55d771ce95f8d 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LetSemiApply.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LetSemiApply.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * For every row in left, set that row as the argument, and apply to right. Produce left row, and set 'idName' = diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Limit.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Limit.scala index 155dcc3298964..f725ee6ed2003 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Limit.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Limit.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.expressions.Expression +import org.opencypher.v9_0.util.attribution.IdGen /* * Only produce the first 'count' rows from source. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LoadCSV.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LoadCSV.scala index 33f5e12b12266..22bc6681990cc 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LoadCSV.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LoadCSV.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.expressions.Expression import org.neo4j.cypher.internal.ir.v3_5._ -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * Operator which loads a CSV from some URL. For every source row, the CSV is loaded. Each CSV line is produced as a diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LockNodes.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LockNodes.scala index cb1aad7918228..f588e12046b92 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LockNodes.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LockNodes.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * For every source row, the nodes assigned to each of the 'nodesToLock' are locked exclusively. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LogicalPlan.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LogicalPlan.scala index c1f5ca193f43a..dd00810479261 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LogicalPlan.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LogicalPlan.scala @@ -22,11 +22,11 @@ package org.neo4j.cypher.internal.v3_5.logical.plans import java.lang.reflect.Method import org.neo4j.cypher.internal.ir.v3_5.{PlannerQuery, Strictness} -import org.neo4j.cypher.internal.util.v3_5.Foldable._ -import org.neo4j.cypher.internal.util.v3_5.Rewritable._ -import org.neo4j.cypher.internal.util.v3_5.attribution.{Id, IdGen, SameId} -import org.neo4j.cypher.internal.util.v3_5.{Foldable, InternalException, Rewritable, Unchangeable} -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.util.Foldable._ +import org.opencypher.v9_0.util.Rewritable._ +import org.opencypher.v9_0.util.attribution.{Id, IdGen, SameId} +import org.opencypher.v9_0.util.{Foldable, InternalException, Rewritable, Unchangeable} +import org.opencypher.v9_0.expressions.Expression import scala.util.hashing.MurmurHash3 import scala.collection.mutable @@ -185,7 +185,7 @@ abstract class LogicalPlan(idGen: IdGen) def flatten: Seq[LogicalPlan] = Flattener.create(this) def indexUsage: Seq[IndexUsage] = { - import org.neo4j.cypher.internal.util.v3_5.Foldable._ + import org.opencypher.v9_0.util.Foldable._ this.fold(Seq.empty[IndexUsage]) { case NodeIndexSeek(idName, label, propertyKeys, _, _) => (acc) => acc :+ SchemaIndexSeekUsage(idName, label.nameId.id, label.name, propertyKeys.map(_.name)) diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/MergeCreateNode.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/MergeCreateNode.scala index 6544a6bdce406..004226aa01a7d 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/MergeCreateNode.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/MergeCreateNode.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, LabelName} +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions.{Expression, LabelName} /** * For each input row, create a new node with the provided labels and properties, diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/MergeCreateRelationship.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/MergeCreateRelationship.scala index ba87d36a10fee..690cbc2a561c3 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/MergeCreateRelationship.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/MergeCreateRelationship.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, RelTypeName} +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions.{Expression, RelTypeName} /** * For each input row, create a new relationship with the provided type and properties, diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NestedPlanExpression.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NestedPlanExpression.scala index 8d9ab764571f3..0b816b72ba84c 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NestedPlanExpression.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NestedPlanExpression.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.frontend.v3_5.SemanticCheck -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticCheckResult, SemanticCheckableExpression} -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.v3_5.expressions.Expression -import org.neo4j.cypher.internal.v3_5.expressions.Expression.SemanticContext +import org.opencypher.v9_0.ast.semantics.SemanticCheck +import org.opencypher.v9_0.ast.semantics.{SemanticCheckResult, SemanticCheckableExpression} +import org.opencypher.v9_0.util.InputPosition +import org.opencypher.v9_0.expressions.Expression +import org.opencypher.v9_0.expressions.Expression.SemanticContext case class NestedPlanExpression( plan: LogicalPlan, diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeByIdSeek.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeByIdSeek.scala index 04182fcd540cf..c5f6329d690b0 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeByIdSeek.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeByIdSeek.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * For each nodeId in 'nodeIds', fetch the corresponding node. Produce one row with the contents of argument and diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeByLabelScan.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeByLabelScan.scala index 73d10d9829378..afbc5807bfd93 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeByLabelScan.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeByLabelScan.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions.LabelName +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions.LabelName /** * Produce one row for every node in the graph labelled 'label'. This row contains the node (assigned to 'idName') diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeCountFromCountStore.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeCountFromCountStore.scala index 280df3509cbe4..4c253ce409bde 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeCountFromCountStore.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeCountFromCountStore.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions.LabelName +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions.LabelName /** * Produce a single row with the contents of argument and a new value 'idName'. For each label in 'labelNames' the diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeHashJoin.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeHashJoin.scala index e976592c8f929..c56850d48f480 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeHashJoin.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeHashJoin.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * Join two result streams using a hash table. 'Left' is completely consumed and buffered in a hash table, using a diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeIndexContainsScan.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeIndexContainsScan.scala index c460693ee0c4a..1ebce6689e9f2 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeIndexContainsScan.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeIndexContainsScan.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, LabelToken, PropertyKeyToken} +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions.{Expression, LabelToken, PropertyKeyToken} /** * This operator does a full scan of an index, producing rows for all entries that contain a string value diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeIndexEndsWithScan.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeIndexEndsWithScan.scala index 4710d783c19cf..71acf4d646ebb 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeIndexEndsWithScan.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeIndexEndsWithScan.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, LabelToken, PropertyKeyToken} +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions.{Expression, LabelToken, PropertyKeyToken} /** * This operator does a full scan of an index, producing rows for all entries that end with a string value diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeIndexScan.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeIndexScan.scala index cccc3ae65b6a0..fb6e3acb4ee8d 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeIndexScan.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeIndexScan.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions.{LabelToken, PropertyKeyToken} +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions.{LabelToken, PropertyKeyToken} /** * This operator does a full scan of an index, producing one row per entry. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeIndexSeek.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeIndexSeek.scala index 76de78c628121..1b15e085e66b1 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeIndexSeek.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeIndexSeek.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, LabelToken, PropertyKeyToken} +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions.{Expression, LabelToken, PropertyKeyToken} /** * For every node with the given label and property values, produces one row with that node. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeUniqueIndexSeek.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeUniqueIndexSeek.scala index bb0c54f0ebf4b..a3159a6d2af9c 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeUniqueIndexSeek.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NodeUniqueIndexSeek.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, LabelToken, PropertyKeyToken} +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions.{Expression, LabelToken, PropertyKeyToken} /** * Produces one or zero rows containing the node with the given label and property values. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NonSargable.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NonSargable.scala index c392ec58962a2..44443eff6b214 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NonSargable.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NonSargable.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions._ -import org.neo4j.cypher.internal.v3_5.functions +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.expressions.functions // This is when dynamic properties are used object AsDynamicPropertyNonSeekable { diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Optional.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Optional.scala index 45eb8e2bcbb1d..bf55d6607e9d5 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Optional.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Optional.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * Produces source rows, unless source is empty. In that case, a single row is produced containing argument and any diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ProceduralLogicalPlan.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ProceduralLogicalPlan.scala index c0d0a5ce027ff..8076afc50439b 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ProceduralLogicalPlan.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ProceduralLogicalPlan.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.symbols.CypherType +import org.opencypher.v9_0.util.symbols.CypherType import org.neo4j.cypher.internal.ir.v3_5._ -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions._ abstract class ProceduralLogicalPlan(idGen: IdGen) extends LogicalPlan(idGen) { override def lhs: Option[LogicalPlan] = None diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ProcedureCall.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ProcedureCall.scala index 028f0395dc885..fe0ba8f37bc28 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ProcedureCall.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ProcedureCall.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * For every source row, call the procedure 'call'. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ProcedureSignature.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ProcedureSignature.scala index d410e2b1fbaca..76e06e1079560 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ProcedureSignature.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ProcedureSignature.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.frontend.v3_5.ast.UnresolvedCall -import org.neo4j.cypher.internal.util.v3_5.symbols.CypherType -import org.neo4j.cypher.internal.v3_5.expressions.FunctionInvocation +import org.opencypher.v9_0.ast.UnresolvedCall +import org.opencypher.v9_0.util.symbols.CypherType +import org.opencypher.v9_0.expressions.FunctionInvocation case class ProcedureSignature(name: QualifiedName, inputSignature: IndexedSeq[FieldSignature], diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ProduceResult.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ProduceResult.scala index 882165754b34b..2ed4b8714177a 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ProduceResult.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ProduceResult.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * For every source row, produce a row containing only the variables in 'columns'. The ProduceResult operator is diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ProjectEndpoints.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ProjectEndpoints.scala index 8ee4a56d00b78..670a6abb4b68b 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ProjectEndpoints.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ProjectEndpoints.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.ir.v3_5.PatternLength -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions.RelTypeName +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions.RelTypeName /** * For every source row, consider the path described by the relationships in 'rel' diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Projection.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Projection.scala index 19826da326698..db08f8e7e4e12 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Projection.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Projection.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.expressions.Expression +import org.opencypher.v9_0.util.attribution.IdGen /** * For each source row, produce the source row augmented with 'expressions'. For entry in diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/RelationshipCountFromCountStore.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/RelationshipCountFromCountStore.scala index 948734a69b3a3..eb831005218af 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/RelationshipCountFromCountStore.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/RelationshipCountFromCountStore.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions.{LabelName, RelTypeName} +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions.{LabelName, RelTypeName} /** * Produce a single row with the contents of argument and a new value 'idName'. For each diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/RemoveLabels.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/RemoveLabels.scala index 8fb55657c0982..072330d67e862 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/RemoveLabels.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/RemoveLabels.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions.LabelName +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions.LabelName /** * For each source row, the labels in 'labelNamed' are removed from the node 'idName'. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ResolvedCall.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ResolvedCall.scala index c698af0ecac5e..d485e1f199571 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ResolvedCall.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ResolvedCall.scala @@ -19,14 +19,13 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.{InputPosition, SyntaxException} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticCheckResult._ -import org.neo4j.cypher.internal.frontend.v3_5._ -import org.neo4j.cypher.internal.v3_5.expressions.Expression.SemanticContext -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.v3_5.expressions._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticError, SemanticExpressionCheck, SemanticState} -import org.neo4j.cypher.internal.util.v3_5.symbols.{CypherType, _} +import org.opencypher.v9_0.util.{InputPosition, SyntaxException} +import org.opencypher.v9_0.ast.semantics.SemanticCheckResult._ +import org.opencypher.v9_0.expressions.Expression.SemanticContext +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.ast.semantics.{SemanticCheck, SemanticError, SemanticExpressionCheck, SemanticState} +import org.opencypher.v9_0.util.symbols.{CypherType, _} object ResolvedCall { def apply(signatureLookup: QualifiedName => ProcedureSignature)(unresolved: UnresolvedCall): ResolvedCall = { diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ResolvedFunctionInvocation.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ResolvedFunctionInvocation.scala index 09d47c170e404..3936efa1e4438 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ResolvedFunctionInvocation.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ResolvedFunctionInvocation.scala @@ -19,14 +19,14 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.frontend.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticCheckResult._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics._ -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.v3_5.expressions.Expression.SemanticContext -import org.neo4j.cypher.internal.v3_5.expressions.{CoerceTo, Expression, FunctionInvocation} -import org.neo4j.cypher.internal.v3_5.functions.UserDefinedFunctionInvocation -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.frontend._ +import org.opencypher.v9_0.ast.semantics.SemanticCheckResult._ +import org.opencypher.v9_0.ast.semantics._ +import org.opencypher.v9_0.util.InputPosition +import org.opencypher.v9_0.expressions.Expression.SemanticContext +import org.opencypher.v9_0.expressions.{CoerceTo, Expression, FunctionInvocation} +import org.opencypher.v9_0.expressions.functions.UserDefinedFunctionInvocation +import org.opencypher.v9_0.util.symbols._ object ResolvedFunctionInvocation { diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/RightOuterHashJoin.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/RightOuterHashJoin.scala index 7e41f578b0fa4..9498f1a39ffa9 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/RightOuterHashJoin.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/RightOuterHashJoin.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * Variant of NodeHashJoin. Also builds a hash table using 'left' and produces merged left and right rows using this diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/RollUpApply.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/RollUpApply.scala index 3534e0c49f7ea..5b7f39c2d5604 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/RollUpApply.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/RollUpApply.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * RollUp is the inverse of the Unwind operator. For each left row, diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SeekRangeWrapper.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SeekRangeWrapper.scala index 306368081b3d8..a13115be30688 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SeekRangeWrapper.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SeekRangeWrapper.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.frontend.v3_5.SemanticCheck -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticCheckResult, SemanticCheckableExpression} -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.v3_5.expressions.Expression -import org.neo4j.cypher.internal.v3_5.expressions.Expression.SemanticContext +import org.opencypher.v9_0.ast.semantics.SemanticCheck +import org.opencypher.v9_0.ast.semantics.{SemanticCheckResult, SemanticCheckableExpression} +import org.opencypher.v9_0.util.InputPosition +import org.opencypher.v9_0.expressions.Expression +import org.opencypher.v9_0.expressions.Expression.SemanticContext case class PrefixSeekRangeWrapper( range: PrefixRange[Expression] diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SeekableArgs.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SeekableArgs.scala index 1c40c96f4fd22..4b1abcaaa6244 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SeekableArgs.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SeekableArgs.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.{One, ZeroOneOrMany} -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.{One, ZeroOneOrMany} +import org.opencypher.v9_0.expressions._ sealed trait SeekableArgs { def expr: Expression diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SelectOrSemiApply.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SelectOrSemiApply.scala index 7cadbcd818ca1..fba8e367f9573 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SelectOrSemiApply.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SelectOrSemiApply.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.expressions.Expression +import org.opencypher.v9_0.util.attribution.IdGen /** * Like SemiApply, but with a precondition 'expr'. If 'expr' is true, left row will be produced without diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Selection.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Selection.scala index 584bc32af254c..3762ef8e73774 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Selection.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Selection.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.expressions.Expression +import org.opencypher.v9_0.util.attribution.IdGen /** * For each source row, produce it if all predicates are true. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SemiApply.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SemiApply.scala index 5ac77c7ea061b..5666fa813830e 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SemiApply.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SemiApply.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * For every row in 'left', set that row as the argument, and apply to 'right'. Produce left row, but only if right diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetLabels.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetLabels.scala index 6977f4a50d718..b47ed622b80f1 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetLabels.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetLabels.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions.LabelName +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions.LabelName /** * For each source row, add the labels in 'labelNamed' to the node 'idName'. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetNodePropertiesFromMap.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetNodePropertiesFromMap.scala index e4bf626fe4b9a..cc12f69a926ac 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetNodePropertiesFromMap.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetNodePropertiesFromMap.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.expressions.Expression import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * for ( row <- source ) diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetNodeProperty.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetNodeProperty.scala index b80f34ce6c9c3..2a6cb9cb3575b 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetNodeProperty.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetNodeProperty.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, PropertyKeyName} +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions.{Expression, PropertyKeyName} /** * for ( row <- source ) diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetProperty.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetProperty.scala index 211006dbf8c4e..d750c7be86bc7 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetProperty.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetProperty.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, PropertyKeyName} +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions.{Expression, PropertyKeyName} /** * for ( row <- source ) diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetRelationshipPropertiesFromMap.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetRelationshipPropertiesFromMap.scala index e36ccaa2273c0..9a9a319c19e1c 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetRelationshipPropertiesFromMap.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetRelationshipPropertiesFromMap.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.expressions.Expression import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * for ( row <- source ) diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetRelationshipPropery.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetRelationshipPropery.scala index 568c05adf4e35..172afac545713 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetRelationshipPropery.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetRelationshipPropery.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, PropertyKeyName} +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions.{Expression, PropertyKeyName} /** * for ( row <- source ) diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Skip.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Skip.scala index 44d8f4949a74b..2e3e8367231dd 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Skip.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Skip.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.expressions.Expression +import org.opencypher.v9_0.util.attribution.IdGen /* * Produce source rows except the first 'count' rows, which are ignored. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Sort.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Sort.scala index 0dc6ac975d633..edb52db2bab0a 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Sort.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Sort.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * Buffer all source rows and sort them according to 'sortItems'. Produce the rows in sorted order. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Top.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Top.scala index 1af05ae210681..a2719a8b8a148 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Top.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Top.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.expressions.Expression +import org.opencypher.v9_0.util.attribution.IdGen /* * Sort source rows according to the ordering in 'sortItems'. Only retain the first 'limit' rows, which are diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/TreeBuilder.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/TreeBuilder.scala index ea1f2590d7406..bee3d6ae9ae1f 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/TreeBuilder.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/TreeBuilder.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.util.InternalException import scala.collection.mutable diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/TriadicSelection.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/TriadicSelection.scala index 43ef9cbf58440..95eb8d8c26396 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/TriadicSelection.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/TriadicSelection.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * Triadic selection is used to solve a common query pattern: diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/UndirectedRelationshipByIdSeek.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/UndirectedRelationshipByIdSeek.scala index c47201139aeec..8f4d6c7d2f658 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/UndirectedRelationshipByIdSeek.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/UndirectedRelationshipByIdSeek.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * For each relationship id in 'relIds', fetch the corresponding relationship. For each relationship, diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Union.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Union.scala index 2aa9a140781f6..19ecd77bb0cf5 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Union.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/Union.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen /** * Produce first the 'left' rows, and then the 'right' rows. This operator does not guarantee row uniqueness. diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/UnwindCollection.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/UnwindCollection.scala index d2a94edcec6ef..9596cb2f01496 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/UnwindCollection.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/UnwindCollection.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.v3_5.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.expressions.Expression +import org.opencypher.v9_0.util.attribution.IdGen /** * For each source row, evaluate 'expression'. If 'expression' evaluates to a list, produce one row per list diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ValueHashJoin.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ValueHashJoin.scala index 0b50d09b5073d..a6db67282a69f 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ValueHashJoin.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/ValueHashJoin.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.v3_5.expressions.Equals +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.expressions.Equals /** * The definition of a value join is an equality predicate between two expressions that diff --git a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/package.scala b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/package.scala index cc1f9cfe1e157..9a0f61d0ddc26 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/package.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/package.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical -import org.neo4j.cypher.internal.util.v3_5.NonEmptyList +import org.opencypher.v9_0.util.NonEmptyList package object plans { type Bounds[+V] = NonEmptyList[Bound[V]] diff --git a/community/cypher/cypher-logical-plans-3.5/src/test/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LogicalPlansTest.scala b/community/cypher/cypher-logical-plans-3.5/src/test/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LogicalPlansTest.scala index 6a91045244ac3..e8881752b1a48 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/test/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LogicalPlansTest.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/test/scala/org/neo4j/cypher/internal/v3_5/logical/plans/LogicalPlansTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.util.v3_5.attribution.{IdGen, SequentialIdGen} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.True +import org.opencypher.v9_0.util.InputPosition +import org.opencypher.v9_0.util.attribution.{IdGen, SequentialIdGen} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.True import scala.collection.mutable.ArrayBuffer diff --git a/community/cypher/cypher-logical-plans-3.5/src/test/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NullOrderingTest.scala b/community/cypher/cypher-logical-plans-3.5/src/test/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NullOrderingTest.scala index f649f120f797c..e524e0fdf2659 100644 --- a/community/cypher/cypher-logical-plans-3.5/src/test/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NullOrderingTest.scala +++ b/community/cypher/cypher-logical-plans-3.5/src/test/scala/org/neo4j/cypher/internal/v3_5/logical/plans/NullOrderingTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.v3_5.logical.plans -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class NullOrderingTest extends CypherFunSuite { diff --git a/community/cypher/cypher-planner-3.5/LICENSES.txt b/community/cypher/cypher-planner-3.5/LICENSES.txt index 4f0ed1d6114a9..44540f02dfee4 100644 --- a/community/cypher/cypher-planner-3.5/LICENSES.txt +++ b/community/cypher/cypher-planner-3.5/LICENSES.txt @@ -5,6 +5,12 @@ libraries. For an overview of the licenses see the NOTICE.txt file. ------------------------------------------------------------------------------ Apache Software License, Version 2.0 Caffeine cache + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala ------------------------------------------------------------------------------ diff --git a/community/cypher/cypher-planner-3.5/NOTICE.txt b/community/cypher/cypher-planner-3.5/NOTICE.txt index 5e3e6f250f22a..3ee07661eef86 100644 --- a/community/cypher/cypher-planner-3.5/NOTICE.txt +++ b/community/cypher/cypher-planner-3.5/NOTICE.txt @@ -28,6 +28,12 @@ Third-party licenses Apache Software License, Version 2.0 Caffeine cache + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala diff --git a/community/cypher/cypher-planner-3.5/pom.xml b/community/cypher/cypher-planner-3.5/pom.xml index 6a47600064c03..50054270f2843 100644 --- a/community/cypher/cypher-planner-3.5/pom.xml +++ b/community/cypher/cypher-planner-3.5/pom.xml @@ -90,12 +90,6 @@ provided - - org.neo4j - openCypher-frontend-1 - ${project.version} - - org.neo4j neo4j-cypher-ir-3.5 @@ -125,7 +119,7 @@ org.neo4j - neo4j-cypher-util-3.5 + neo4j-cypher-planner-spi-3.5 ${project.version} test-jar test @@ -133,31 +127,41 @@ org.neo4j - neo4j-cypher-expression-3.5 - ${project.version} + neo4j-io test-jar test + + - org.neo4j - openCypher-frontend-1 - ${project.version} + org.opencypher + util-9.0 + ${openCypher.version} test-jar test - org.neo4j - neo4j-cypher-planner-spi-3.5 - ${project.version} + org.opencypher + ast-9.0 + ${openCypher.version} test-jar test - org.neo4j - neo4j-io + org.opencypher + parser-9.0 + ${openCypher.version} + test-jar + test + + + + org.opencypher + expressions-9.0 + ${openCypher.version} test-jar test diff --git a/community/cypher/cypher-planner-3.5/src/main/java/org/neo4j/cypher/internal/compiler/v3_5/common/CypherOrderability.java b/community/cypher/cypher-planner-3.5/src/main/java/org/neo4j/cypher/internal/compiler/v3_5/common/CypherOrderability.java index 97323f369bdf9..fbcacf3590237 100644 --- a/community/cypher/cypher-planner-3.5/src/main/java/org/neo4j/cypher/internal/compiler/v3_5/common/CypherOrderability.java +++ b/community/cypher/cypher-planner-3.5/src/main/java/org/neo4j/cypher/internal/compiler/v3_5/common/CypherOrderability.java @@ -19,8 +19,6 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.common; -import scala.AnyVal; - import java.util.Arrays; import java.util.Comparator; import java.util.Iterator; @@ -30,8 +28,8 @@ import java.util.stream.IntStream; import java.util.stream.LongStream; -import org.neo4j.cypher.internal.util.v3_5.IncomparableValuesException; -import org.neo4j.cypher.internal.util.v3_5.UnorderableValueException; +import org.opencypher.v9_0.util.IncomparableValuesException; +import org.opencypher.v9_0.util.UnorderableValueException; import org.neo4j.graphdb.Path; import org.neo4j.graphdb.PropertyContainer; import org.neo4j.helpers.MathUtil; diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ContextCreator.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ContextCreator.scala index 9052085a16094..0cde844fb8ef0 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ContextCreator.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ContextCreator.scala @@ -21,11 +21,12 @@ package org.neo4j.cypher.internal.compiler.v3_5 import java.time.Clock -import org.neo4j.cypher.internal.util.v3_5.InputPosition +import org.opencypher.v9_0.util.InputPosition import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{ExpressionEvaluator, MetricsFactory, QueryGraphSolver} -import org.neo4j.cypher.internal.frontend.v3_5.phases.{BaseContext, CompilationPhaseTracer, InternalNotificationLogger, Monitors} +import org.opencypher.v9_0.frontend.phases.{BaseContext, InternalNotificationLogger, Monitors} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanContext -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer +import org.opencypher.v9_0.util.attribution.IdGen trait ContextCreator[Context <: BaseContext] { def create(tracer: CompilationPhaseTracer, diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/CypherCompiler.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/CypherCompiler.scala index e1630ef894cfc..b624b91bbdbc9 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/CypherCompiler.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/CypherCompiler.scala @@ -21,18 +21,18 @@ package org.neo4j.cypher.internal.compiler.v3_5 import java.time.Clock -import org.neo4j.cypher.internal.util.v3_5.InputPosition +import org.opencypher.v9_0.util.InputPosition import org.neo4j.cypher.internal.compiler.v3_5.phases.{CompilerContext, _} import org.neo4j.cypher.internal.compiler.v3_5.planner.logical._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.debug.DebugPrinter import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter.PlanRewriter import org.neo4j.cypher.internal.compiler.v3_5.planner.{CheckForUnresolvedTokens, ResolveTokens} -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.ASTRewriter -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.RewriterStepSequencer -import org.neo4j.cypher.internal.frontend.v3_5.phases._ +import org.opencypher.v9_0.frontend.phases._ import org.neo4j.cypher.internal.ir.v3_5.UnionQuery import org.neo4j.cypher.internal.planner.v3_5.spi.{IDPPlannerName, PlannerNameFor} import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer +import org.opencypher.v9_0.rewriting.RewriterStepSequencer case class CypherCompiler[Context <: CompilerContext](astRewriter: ASTRewriter, monitors: Monitors, diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/CypherCompilerFactory.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/CypherCompilerFactory.scala index 7d29d674bff1d..4396fd9e8c51d 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/CypherCompilerFactory.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/CypherCompilerFactory.scala @@ -23,10 +23,10 @@ import java.time.Clock import org.neo4j.cypher.internal.compiler.v3_5.phases.{CompilerContext, LogicalPlanState} import org.neo4j.cypher.internal.compiler.v3_5.planner.logical._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.{ASTRewriter, IfNoParameter} -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.RewriterStepSequencer -import org.neo4j.cypher.internal.frontend.v3_5.phases.{Monitors, Transformer} import org.neo4j.cypher.internal.planner.v3_5.spi.CostBasedPlannerName +import org.opencypher.v9_0.frontend.phases.{ASTRewriter, Monitors, Transformer} +import org.opencypher.v9_0.rewriting.RewriterStepSequencer +import org.opencypher.v9_0.rewriting.rewriters.IfNoParameter class CypherCompilerFactory[C <: CompilerContext, T <: Transformer[C, LogicalPlanState, LogicalPlanState]] { val monitorTag = "cypher3.3" diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ProcedureCallOrSchemaCommandPlanBuilder.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ProcedureCallOrSchemaCommandPlanBuilder.scala index 7e674bb0e6eb7..ba35e5c31b6b2 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ProcedureCallOrSchemaCommandPlanBuilder.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ProcedureCallOrSchemaCommandPlanBuilder.scala @@ -20,14 +20,14 @@ package org.neo4j.cypher.internal.compiler.v3_5 import org.neo4j.cypher.internal.compiler.v3_5.phases._ -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.PIPE_BUILDING -import org.neo4j.cypher.internal.frontend.v3_5.phases.{BaseState, Condition, Phase} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticCheckResult, SemanticState} -import org.neo4j.cypher.internal.util.v3_5.attribution.SequentialIdGen +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.frontend.phases.{BaseState, Condition, Phase} +import org.opencypher.v9_0.ast.semantics.{SemanticCheckResult, SemanticState} +import org.opencypher.v9_0.util.attribution.SequentialIdGen import org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.v3_5.logical.plans.{LogicalPlan, ResolvedCall} +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase.PIPE_BUILDING /** * This planner takes on queries that requires no planning such as procedures and schema commands diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/SyntaxExceptionCreator.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/SyntaxExceptionCreator.scala index 7e60a28e09cfa..8c769f6f05d86 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/SyntaxExceptionCreator.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/SyntaxExceptionCreator.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.compiler.v3_5 -import org.neo4j.cypher.internal.util.v3_5.{CypherException, InputPosition, SyntaxException} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticErrorDef +import org.opencypher.v9_0.util.{CypherException, InputPosition, SyntaxException} +import org.opencypher.v9_0.ast.semantics.SemanticErrorDef class SyntaxExceptionCreator(queryText: String, preParserOffset: Option[InputPosition]) extends ((String, InputPosition) => CypherException) { override def apply(message: String, position: InputPosition): CypherException = { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/QueryTagger.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/QueryTagger.scala index 9b4333931a311..aeadd03ad79b9 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/QueryTagger.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/QueryTagger.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast -import org.neo4j.cypher.internal.util.v3_5.ASTNode -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.v3_5.functions._ -import org.neo4j.cypher.internal.frontend.v3_5.parser.CypherParser -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.ASTNode +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.expressions.functions._ +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.parser.CypherParser import scala.annotation.tailrec import scala.util.{Failure, Success, Try} diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/containsNamedPathOnlyForShortestPath.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/containsNamedPathOnlyForShortestPath.scala index 513f3b43d0851..9d608c3b820ae 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/containsNamedPathOnlyForShortestPath.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/containsNamedPathOnlyForShortestPath.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.conditions -import org.neo4j.cypher.internal.frontend.v3_5.ast.conditions.containsNoMatchingNodes -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.Condition -import org.neo4j.cypher.internal.v3_5.expressions.{NamedPatternPart, ShortestPaths} +import org.opencypher.v9_0.ast.conditions.containsNoMatchingNodes +import org.opencypher.v9_0.expressions.{NamedPatternPart, ShortestPaths} +import org.opencypher.v9_0.rewriting.Condition case object containsNamedPathOnlyForShortestPath extends Condition { private val matcher = containsNoMatchingNodes({ diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/ClauseConverters.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/ClauseConverters.scala index 8f392943963f5..c4beb71347259 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/ClauseConverters.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/ClauseConverters.scala @@ -19,15 +19,15 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.convert.plannerQuery -import org.neo4j.cypher.internal.util.v3_5.{InternalException, SyntaxException} +import org.opencypher.v9_0.util.{InternalException, SyntaxException} import org.neo4j.cypher.internal.compiler.v3_5.planner._ -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5.helpers.ExpressionConverters._ import org.neo4j.cypher.internal.ir.v3_5.helpers.PatternConverters._ import org.neo4j.cypher.internal.ir.v3_5.{NoHeaders, _} import org.neo4j.cypher.internal.v3_5.logical.plans.ResolvedCall -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ import scala.collection.mutable diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/PlannerQueryBuilder.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/PlannerQueryBuilder.scala index cfbfc6b92ea91..b95b5cfccc478 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/PlannerQueryBuilder.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/PlannerQueryBuilder.scala @@ -20,11 +20,11 @@ package org.neo4j.cypher.internal.compiler.v3_5.ast.convert.plannerQuery import org.neo4j.cypher.internal.compiler.v3_5.helpers.ListSupport -import org.neo4j.cypher.internal.frontend.v3_5.ast.RelationshipStartItem -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.RelationshipStartItem +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5._ -import org.neo4j.cypher.internal.util.v3_5.UnNamedNameGenerator -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.UnNamedNameGenerator +import org.opencypher.v9_0.expressions.SemanticDirection import scala.collection.mutable @@ -135,7 +135,7 @@ case class PlannerQueryBuilder(private val q: PlannerQuery, semanticTable: Seman } def groupInequalities(plannerQuery: PlannerQuery): PlannerQuery = { - import org.neo4j.cypher.internal.util.v3_5.NonEmptyList._ + import org.opencypher.v9_0.util.NonEmptyList._ plannerQuery .amendQueryGraph(_.mapSelections { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/StatementConverters.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/StatementConverters.scala index b36d59d34933b..2d7afd2fa0c1d 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/StatementConverters.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/StatementConverters.scala @@ -19,16 +19,16 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.convert.plannerQuery -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InternalException} +import org.opencypher.v9_0.util.{ASTNode, InternalException} import org.neo4j.cypher.internal.compiler.v3_5.ast.convert.plannerQuery.ClauseConverters._ -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.ast +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5.{PeriodicCommit, UnionQuery} -import org.neo4j.cypher.internal.v3_5.expressions.{And, Or} +import org.opencypher.v9_0.expressions.{And, Or} object StatementConverters { - import org.neo4j.cypher.internal.util.v3_5.Foldable._ + import org.opencypher.v9_0.util.Foldable._ def toPlannerQueryBuilder(q: SingleQuery, semanticTable: SemanticTable): PlannerQueryBuilder = q.clauses.foldLeft(PlannerQueryBuilder(semanticTable)) { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/groupInequalityPredicates.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/groupInequalityPredicates.scala index db0929ecbf379..111e4087608da 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/groupInequalityPredicates.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/groupInequalityPredicates.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.convert.plannerQuery -import org.neo4j.cypher.internal.util.v3_5.NonEmptyList +import org.opencypher.v9_0.util.NonEmptyList import org.neo4j.cypher.internal.ir.v3_5.Predicate -import org.neo4j.cypher.internal.v3_5.expressions.{AndedPropertyInequalities, InequalityExpression, Property, Variable} +import org.opencypher.v9_0.expressions.{AndedPropertyInequalities, InequalityExpression, Property, Variable} // This transforms // diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/InliningContext.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/InliningContext.scala index 30e9dee4b7520..b5e6c0599590d 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/InliningContext.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/InliningContext.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, TypedRewriter, bottomUp} +import org.opencypher.v9_0.util.{Rewriter, TypedRewriter, bottomUp} import org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters.InliningContext._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.copyVariables -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.rewriting.rewriters.copyVariables +import org.opencypher.v9_0.expressions._ case class InliningContext(projections: Map[LogicalVariable, Expression] = Map.empty, seenVariables: Set[LogicalVariable] = Set.empty, diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/inlineProjections.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/inlineProjections.scala index 8fc6ecdea2c0e..2c1d744f885bc 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/inlineProjections.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/inlineProjections.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.helpers.fixedPoint -import org.neo4j.cypher.internal.util.v3_5._ -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, LogicalVariable, Pattern} +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.util._ +import org.opencypher.v9_0.expressions.{Expression, LogicalVariable, Pattern} +import org.opencypher.v9_0.util.helpers.fixedPoint case object inlineProjections extends Rewriter { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/inliningContextCreator.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/inliningContextCreator.scala index a757f5e777a66..c05b7adf54935 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/inliningContextCreator.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/inliningContextCreator.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.frontend.v3_5.ast -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.ast +import org.opencypher.v9_0.expressions._ object inliningContextCreator extends (ast.Statement => InliningContext) { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/namePatternPredicatePatternElements.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/namePatternPredicatePatternElements.scala index 773d4e5fa657f..95c437d3b4caa 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/namePatternPredicatePatternElements.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/namePatternPredicatePatternElements.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.PatternExpressionPatternElementNamer -import org.neo4j.cypher.internal.v3_5.expressions.PatternExpression +import org.opencypher.v9_0.util.{Rewriter, bottomUp} +import org.opencypher.v9_0.rewriting.rewriters.PatternExpressionPatternElementNamer +import org.opencypher.v9_0.expressions.PatternExpression case object namePatternPredicatePatternElements extends Rewriter { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/reattachAliasedExpressions.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/reattachAliasedExpressions.scala index 8c1eb58354660..c1c9ae1bac3c7 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/reattachAliasedExpressions.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/reattachAliasedExpressions.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.frontend.v3_5.ast.{Return, ReturnItem, With} -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, Variable} +import org.opencypher.v9_0.util.{Rewriter, bottomUp} +import org.opencypher.v9_0.ast.{Return, ReturnItem, With} +import org.opencypher.v9_0.expressions.{Expression, Variable} case object reattachAliasedExpressions extends Rewriter { override def apply(in: AnyRef): AnyRef = findingRewriter.apply(in) diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/Tapper.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/Tapper.scala deleted file mode 100644 index ff501031f684c..0000000000000 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/Tapper.scala +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * This file is part of Neo4j. - * - * Neo4j is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.neo4j.cypher.internal.compiler.v3_5.helpers - -object Tapper { - implicit class Tapped[V](value: V) { - def tap(f: V => Unit): V = { - f(value) - value - } - } - - implicit class TappedOption[V](value: Option[V]) { - def tapSomeOrFail(f: V => Unit): Option[V] = { - f(value.get) - value - } - } -} diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/CompilationContains.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/CompilationContains.scala index 1f1b611022dc2..6b84ed827555c 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/CompilationContains.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/CompilationContains.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.phases -import org.neo4j.cypher.internal.frontend.v3_5.ast.Statement -import org.neo4j.cypher.internal.frontend.v3_5.phases.Condition -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticState +import org.opencypher.v9_0.ast.Statement +import org.opencypher.v9_0.frontend.phases.Condition +import org.opencypher.v9_0.ast.semantics.SemanticState import org.neo4j.cypher.internal.ir.v3_5.UnionQuery import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/CompilerContext.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/CompilerContext.scala index d11d68a5a0df7..f6c7f4bea1234 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/CompilerContext.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/CompilerContext.scala @@ -21,13 +21,14 @@ package org.neo4j.cypher.internal.compiler.v3_5.phases import java.time.Clock -import org.neo4j.cypher.internal.util.v3_5.{CypherException, InputPosition} +import org.opencypher.v9_0.util.{CypherException, InputPosition} import org.neo4j.cypher.internal.compiler.v3_5._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{Metrics, QueryGraphSolver} -import org.neo4j.cypher.internal.frontend.v3_5.phases.{BaseContext, CompilationPhaseTracer, InternalNotificationLogger, Monitors} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticErrorDef +import org.opencypher.v9_0.frontend.phases.{BaseContext, InternalNotificationLogger, Monitors} +import org.opencypher.v9_0.ast.semantics.SemanticErrorDef import org.neo4j.cypher.internal.planner.v3_5.spi.PlanContext -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer +import org.opencypher.v9_0.util.attribution.IdGen class CompilerContext(val exceptionCreator: (String, InputPosition) => CypherException, val tracer: CompilationPhaseTracer, diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/CreatePlannerQuery.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/CreatePlannerQuery.scala index 7e2f18149d43b..6c037e408918b 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/CreatePlannerQuery.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/CreatePlannerQuery.scala @@ -19,13 +19,14 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.phases -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.util.InternalException import org.neo4j.cypher.internal.compiler.v3_5.ast.convert.plannerQuery.StatementConverters._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.Query -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.LOGICAL_PLANNING -import org.neo4j.cypher.internal.frontend.v3_5.phases.{BaseContext, BaseState, Phase} +import org.opencypher.v9_0.ast.Query +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase.LOGICAL_PLANNING +import org.opencypher.v9_0.frontend.phases.{BaseContext, BaseState, Phase} import org.neo4j.cypher.internal.ir.v3_5.UnionQuery + object CreatePlannerQuery extends Phase[BaseContext, BaseState, LogicalPlanState] { override def phase = LOGICAL_PLANNING diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/DeprecationWarnings.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/DeprecationWarnings.scala index 1c518f3131993..976d14262e751 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/DeprecationWarnings.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/DeprecationWarnings.scala @@ -19,11 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.phases -import org.neo4j.cypher.internal.frontend.v3_5.ast.{ProcedureResultItem, Statement, UnresolvedCall} -import org.neo4j.cypher.internal.frontend.v3_5.notification.{DeprecatedFieldNotification, DeprecatedProcedureNotification, InternalNotification, ProcedureWarningNotification} -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.DEPRECATION_WARNINGS -import org.neo4j.cypher.internal.frontend.v3_5.phases.{BaseContext, BaseState, VisitorPhase} -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.ast.{ProcedureResultItem, Statement, UnresolvedCall} +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase.DEPRECATION_WARNINGS +import org.opencypher.v9_0.frontend.phases.{BaseContext, BaseState, VisitorPhase} +import org.opencypher.v9_0.util._ import org.neo4j.cypher.internal.v3_5.logical.plans.{FieldSignature, ProcedureSignature, ResolvedCall} object ProcedureDeprecationWarnings extends VisitorPhase[BaseContext, BaseState] { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/LogicalPlanState.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/LogicalPlanState.scala index 2916a1ad85dae..eb1f0ffbf0f25 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/LogicalPlanState.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/LogicalPlanState.scala @@ -20,13 +20,13 @@ package org.neo4j.cypher.internal.compiler.v3_5.phases import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.frontend.v3_5.PlannerName -import org.neo4j.cypher.internal.frontend.v3_5.ast.{Query, Statement} -import org.neo4j.cypher.internal.frontend.v3_5.phases.{BaseState, Condition} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticState, SemanticTable} +import org.opencypher.v9_0.util.InputPosition +import org.opencypher.v9_0.frontend.PlannerName +import org.opencypher.v9_0.ast.{Query, Statement} +import org.opencypher.v9_0.frontend.phases.{BaseState, Condition} +import org.opencypher.v9_0.ast.semantics.{SemanticState, SemanticTable} import org.neo4j.cypher.internal.ir.v3_5.{PeriodicCommit, UnionQuery} -import org.neo4j.cypher.internal.util.v3_5.symbols.CypherType +import org.opencypher.v9_0.util.symbols.CypherType import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan /* diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/RewriteProcedureCalls.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/RewriteProcedureCalls.scala index c41084ada32c2..0f480ece75252 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/RewriteProcedureCalls.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/RewriteProcedureCalls.scala @@ -19,14 +19,14 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.phases -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.conditions.{StatementCondition, containsNoNodesOfType} -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.AST_REWRITE -import org.neo4j.cypher.internal.frontend.v3_5.phases.{BaseState, Condition, Phase} +import org.opencypher.v9_0.util.{Rewriter, bottomUp} +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.ast.conditions.containsNoNodesOfType +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase.AST_REWRITE +import org.opencypher.v9_0.frontend.phases.{BaseState, Condition, Phase, StatementCondition} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanContext import org.neo4j.cypher.internal.v3_5.logical.plans.{ResolvedCall, ResolvedFunctionInvocation} -import org.neo4j.cypher.internal.v3_5.expressions.FunctionInvocation +import org.opencypher.v9_0.expressions.FunctionInvocation // Given a way to lookup procedure signatures, this phase rewrites unresolved calls into resolved calls case object RewriteProcedureCalls extends Phase[CompilerContext, BaseState, BaseState] { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/CantCompileQueryException.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/CantCompileQueryException.scala index c057c44c78f43..bb02e03ccba20 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/CantCompileQueryException.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/CantCompileQueryException.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner -import org.neo4j.cypher.internal.util.v3_5.CypherException -import org.neo4j.cypher.internal.util.v3_5.spi.MapToPublicExceptions +import org.opencypher.v9_0.util.CypherException +import org.opencypher.v9_0.util.spi.MapToPublicExceptions class CantCompileQueryException(message: String = "Internal error - should have used fall back to execute query, but something went horribly wrong", cause:Throwable=null) extends CypherException(message, cause) { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/CheckForUnresolvedTokens.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/CheckForUnresolvedTokens.scala index ec9744c6ec292..74d15e1c6cf9f 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/CheckForUnresolvedTokens.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/CheckForUnresolvedTokens.scala @@ -20,11 +20,10 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner import org.neo4j.cypher.internal.compiler.v3_5.phases.LogicalPlanState -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.notification.{InternalNotification, MissingLabelNotification, MissingPropertyNameNotification, MissingRelTypeNotification} -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.LOGICAL_PLANNING -import org.neo4j.cypher.internal.frontend.v3_5.phases.{BaseContext, VisitorPhase} -import org.neo4j.cypher.internal.v3_5.expressions.{LabelName, Property, PropertyKeyName, RelTypeName} +import org.opencypher.v9_0.expressions.{LabelName, Property, PropertyKeyName, RelTypeName} +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase.LOGICAL_PLANNING +import org.opencypher.v9_0.frontend.phases.{BaseContext, VisitorPhase} +import org.opencypher.v9_0.util.{InternalNotification, MissingLabelNotification, MissingPropertyNameNotification, MissingRelTypeNotification} object CheckForUnresolvedTokens extends VisitorPhase[BaseContext, LogicalPlanState] { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/ResolveTokens.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/ResolveTokens.scala index 474482c0ba7c3..e9f7821777630 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/ResolveTokens.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/ResolveTokens.scala @@ -20,13 +20,13 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner import org.neo4j.cypher.internal.compiler.v3_5.phases._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.Query -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.AST_REWRITE -import org.neo4j.cypher.internal.frontend.v3_5.phases.{BaseState, VisitorPhase} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.Query +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase.AST_REWRITE +import org.opencypher.v9_0.frontend.phases.{BaseState, VisitorPhase} +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.planner.v3_5.spi.TokenContext -import org.neo4j.cypher.internal.util.v3_5.{LabelId, PropertyKeyId, RelTypeId} -import org.neo4j.cypher.internal.v3_5.expressions.{LabelName, PropertyKeyName, RelTypeName} +import org.opencypher.v9_0.util.{LabelId, PropertyKeyId, RelTypeId} +import org.opencypher.v9_0.expressions.{LabelName, PropertyKeyName, RelTypeName} object ResolveTokens extends VisitorPhase[CompilerContext, BaseState] { def resolve(ast: Query)(implicit semanticTable: SemanticTable, tokenContext: TokenContext) { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/Selections.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/Selections.scala index c139bec89ec5c..697b6fa367198 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/Selections.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/Selections.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan import org.neo4j.cypher.internal.ir.v3_5.Selections import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Solveds -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.expressions.Expression case class unsolvedPreds(solveds: Solveds) extends ((Selections, LogicalPlan) => Seq[Expression]) { def apply(s: Selections, l: LogicalPlan): Seq[Expression] = diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CardinalityCostModel.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CardinalityCostModel.scala index 740b4f53dd287..59b50e711ace8 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CardinalityCostModel.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CardinalityCostModel.scala @@ -23,8 +23,8 @@ import org.neo4j.cypher.internal.compiler.v3_5.CypherCompilerConfiguration import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics._ import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, Cost, CostPerRow, Multiplier} -import org.neo4j.cypher.internal.v3_5.expressions.{HasLabels, Property} +import org.opencypher.v9_0.util.{Cardinality, Cost, CostPerRow, Multiplier} +import org.opencypher.v9_0.expressions.{HasLabels, Property} import org.neo4j.cypher.internal.v3_5.logical.plans._ case class CardinalityCostModel(config: CypherCompilerConfiguration) extends CostModel { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/Eagerness.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/Eagerness.scala index b6dc0b725e902..5185159605350 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/Eagerness.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/Eagerness.scala @@ -19,12 +19,12 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical -import org.neo4j.cypher.internal.frontend.v3_5.helpers.fixedPoint import org.neo4j.cypher.internal.ir.v3_5.{PlannerQuery, QueryGraph} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Solveds -import org.neo4j.cypher.internal.util.v3_5.attribution.{Attributes, SameId} -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} +import org.opencypher.v9_0.util.attribution.{Attributes, SameId} +import org.opencypher.v9_0.util.{Rewriter, bottomUp} import org.neo4j.cypher.internal.v3_5.logical.plans._ +import org.opencypher.v9_0.util.helpers.fixedPoint import scala.annotation.tailrec diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/LogicalPlanningContext.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/LogicalPlanningContext.scala index 7550cfe4c98da..1289e6c7a1bb2 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/LogicalPlanningContext.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/LogicalPlanningContext.scala @@ -20,18 +20,16 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.csv.reader.Configuration.DEFAULT_LEGACY_STYLE_QUOTING -import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics.{CardinalityModel, CostModel} -import org.neo4j.cypher.internal.planner.v3_5.spi.GraphStatistics -import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics.QueryGraphSolverInput +import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics.{CardinalityModel, CostModel, QueryGraphSolverInput} import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.{CostComparisonListener, LogicalPlanProducer} -import org.neo4j.cypher.internal.frontend.v3_5.phases.InternalNotificationLogger -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.planner.v3_5.spi.PlanContext +import org.neo4j.cypher.internal.planner.v3_5.spi.{GraphStatistics, PlanContext} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.Cardinality import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan -import org.neo4j.cypher.internal.v3_5.expressions.Variable +import org.opencypher.v9_0.ast.semantics.SemanticTable +import org.opencypher.v9_0.expressions.Variable +import org.opencypher.v9_0.frontend.phases.InternalNotificationLogger +import org.opencypher.v9_0.util.Cardinality case class LogicalPlanningContext(planContext: PlanContext, logicalPlanProducer: LogicalPlanProducer, diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/LogicalPlanningFunction.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/LogicalPlanningFunction.scala index 60dc9f736b47f..29ad01b462209 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/LogicalPlanningFunction.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/LogicalPlanningFunction.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.expressions.Expression import org.neo4j.cypher.internal.ir.v3_5.QueryGraph import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/LogicalPlanningSupport.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/LogicalPlanningSupport.scala index b83c89fd46215..fd8fcc7990c3c 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/LogicalPlanningSupport.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/LogicalPlanningSupport.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical -import org.neo4j.cypher.internal.frontend.v3_5.ast.Hint +import org.opencypher.v9_0.ast.Hint object LogicalPlanningSupport { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/Metrics.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/Metrics.scala index 044c099249cf3..4cc899460e0aa 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/Metrics.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/Metrics.scala @@ -21,14 +21,14 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.CypherCompilerConfiguration import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics.{CardinalityModel, CostModel, QueryGraphCardinalityModel} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5.{PlannerQuery, _} import org.neo4j.cypher.internal.planner.v3_5.spi.GraphStatistics import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, Cost} +import org.opencypher.v9_0.util.{Cardinality, Cost} import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, FunctionInvocation, LabelName, Parameter} -import org.neo4j.cypher.internal.v3_5.functions.{Rand, Timestamp} +import org.opencypher.v9_0.expressions.{Expression, FunctionInvocation, LabelName, Parameter} +import org.opencypher.v9_0.expressions.functions.{Rand, Timestamp} import scala.language.implicitConversions diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/OptionalMatchRemover.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/OptionalMatchRemover.scala index dc90053de1e69..1f78b5a2015a1 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/OptionalMatchRemover.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/OptionalMatchRemover.scala @@ -19,14 +19,14 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical -import org.neo4j.cypher.internal.util.v3_5.Rewritable._ -import org.neo4j.cypher.internal.util.v3_5.{InputPosition, Rewriter, topDown} +import org.opencypher.v9_0.util.Rewritable._ +import org.opencypher.v9_0.util.{InputPosition, Rewriter, topDown} import org.neo4j.cypher.internal.compiler.v3_5.phases.{CompilerContext, LogicalPlanState} -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.LOGICAL_PLANNING -import org.neo4j.cypher.internal.frontend.v3_5.phases.{Condition, Phase} +import org.opencypher.v9_0.frontend.phases.{Condition, Phase} import org.neo4j.cypher.internal.ir.v3_5._ -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase.LOGICAL_PLANNING import scala.annotation.tailrec import scala.collection.mutable.ListBuffer diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanEventHorizon.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanEventHorizon.scala index 321a41ec4dba1..f01ff4522bb3f 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanEventHorizon.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanEventHorizon.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.util.InternalException import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.{PatternExpressionSolver, aggregation, projection, sortSkipAndLimit} import org.neo4j.cypher.internal.ir.v3_5._ diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanSingleQuery.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanSingleQuery.scala index d2cb880182cbf..8286fbbc38815 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanSingleQuery.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanSingleQuery.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.{countStorePlanner, verifyBestPlan} import org.neo4j.cypher.internal.ir.v3_5.PlannerQuery import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.attribution.{Attributes, IdGen} +import org.opencypher.v9_0.util.attribution.{Attributes, IdGen} import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan /* diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanUpdates.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanUpdates.scala index 91bbf8d68e518..6322c87e34c1e 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanUpdates.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanUpdates.scala @@ -22,8 +22,8 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.{LogicalPlanProducer, mergeUniqueIndexSeekLeafPlanner} import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.v3_5.expressions.{ContainerIndex, PathExpression, Variable} +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.expressions.{ContainerIndex, PathExpression, Variable} import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan /* diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanWithTail.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanWithTail.scala index 5a9bf69c136b4..3b2081e951fbe 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanWithTail.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanWithTail.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.ir.v3_5.PlannerQuery import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.attribution.Attributes +import org.opencypher.v9_0.util.attribution.Attributes import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan /* diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/QueryGraphSolver.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/QueryGraphSolver.scala index 3107460faf931..2965fbc2f300e 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/QueryGraphSolver.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/QueryGraphSolver.scala @@ -19,12 +19,12 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.util.InternalException import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.PatternExpressionPatternElementNamer +import org.opencypher.v9_0.rewriting.rewriters.PatternExpressionPatternElementNamer import org.neo4j.cypher.internal.ir.v3_5.QueryGraph import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ trait QueryGraphSolver { def plan(queryGraph: QueryGraph, context: LogicalPlanningContext, solveds: Solveds, cardinalities: Cardinalities): LogicalPlan diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/QueryPlanner.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/QueryPlanner.scala index 64eec7efa673d..14f43c4c6d8aa 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/QueryPlanner.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/QueryPlanner.scala @@ -22,13 +22,13 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.phases._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics.{CostModel, QueryGraphSolverInput} import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.{LogicalPlanProducer, SystemOutCostLogger, devNullListener} -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.LOGICAL_PLANNING -import org.neo4j.cypher.internal.frontend.v3_5.phases.Phase import org.neo4j.cypher.internal.ir.v3_5.{PeriodicCommit, PlannerQuery, UnionQuery} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.Cost -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase.LOGICAL_PLANNING +import org.opencypher.v9_0.frontend.phases.Phase +import org.opencypher.v9_0.util.Cost +import org.opencypher.v9_0.util.attribution.IdGen case class QueryPlanner(planSingleQuery: ((PlannerQuery, LogicalPlanningContext, Solveds, Cardinalities, IdGen) => LogicalPlan) = PlanSingleQuery()) extends Phase[CompilerContext, LogicalPlanState, LogicalPlanState] { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/ReportCostComparisonsAsRows.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/ReportCostComparisonsAsRows.scala index 1618ab353785e..fec51c25c6a64 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/ReportCostComparisonsAsRows.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/ReportCostComparisonsAsRows.scala @@ -21,13 +21,13 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.phases.LogicalPlanState import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.CostComparisonListener -import org.neo4j.cypher.internal.frontend.v3_5.ast._ import org.neo4j.cypher.internal.ir.v3_5.PlannerQuery import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, Cost, InputPosition} -import org.neo4j.cypher.internal.util.v3_5.attribution.{Id, SequentialIdGen} -import org.neo4j.cypher.internal.v3_5.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans._ +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.util.attribution.{Id, SequentialIdGen} +import org.opencypher.v9_0.util.{Cardinality, Cost, InputPosition} import scala.collection.{immutable, mutable} diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/StatisticsBackedCardinalityModel.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/StatisticsBackedCardinalityModel.scala index d192facdf8b6a..2d67dc62668e2 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/StatisticsBackedCardinalityModel.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/StatisticsBackedCardinalityModel.scala @@ -22,11 +22,11 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.helpers.MapSupport._ import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics.{CardinalityModel, QueryGraphCardinalityModel, QueryGraphSolverInput} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.planner.v3_5.spi.GraphStatistics -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, Multiplier, Selectivity} -import org.neo4j.cypher.internal.v3_5.expressions.IntegerLiteral +import org.opencypher.v9_0.util.{Cardinality, Multiplier, Selectivity} +import org.opencypher.v9_0.expressions.IntegerLiteral import org.neo4j.values.storable.NumberValue class StatisticsBackedCardinalityModel(queryGraphCardinalityModel: QueryGraphCardinalityModel, simpleExpressionEvaluator: ExpressionEvaluator) extends CardinalityModel { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/ExpressionSelectivityCalculator.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/ExpressionSelectivityCalculator.scala index 90e32682018f1..5a85003c5c6d6 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/ExpressionSelectivityCalculator.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/ExpressionSelectivityCalculator.scala @@ -23,13 +23,13 @@ import java.math import java.math.RoundingMode import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5.Selections import org.neo4j.cypher.internal.planner.v3_5.spi.{GraphStatistics, IndexDescriptor} import org.neo4j.cypher.internal.planner.v3_5.spi.GraphStatistics._ -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, LabelId, Selectivity} -import org.neo4j.cypher.internal.v3_5.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans.PrefixRange +import org.opencypher.v9_0.ast.semantics.SemanticTable +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.util.{Cardinality, LabelId, Selectivity} trait Expression2Selectivity { def apply(exp: Expression)(implicit semanticTable: SemanticTable, selections: Selections): Selectivity diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/SelectivityCombiner.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/SelectivityCombiner.scala index 993a3301e9832..418b5105777e8 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/SelectivityCombiner.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/SelectivityCombiner.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.cardinality import java.math -import org.neo4j.cypher.internal.util.v3_5.Selectivity +import org.opencypher.v9_0.util.Selectivity trait SelectivityCombiner { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/SelectivityEstimator.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/SelectivityEstimator.scala index ecaf97f91f871..cc0501284db51 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/SelectivityEstimator.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/SelectivityEstimator.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.cardinality -import org.neo4j.cypher.internal.v3_5.expressions.Expression -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.expressions.Expression +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5.Selections import org.neo4j.cypher.internal.planner.v3_5.spi.GraphStatistics -import org.neo4j.cypher.internal.util.v3_5.Selectivity +import org.opencypher.v9_0.util.Selectivity trait SelectivityEstimator extends (Expression => Selectivity) { self: SelectivityEstimator => diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/TokenSpec.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/TokenSpec.scala index c611581efca12..81a497d079a1d 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/TokenSpec.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/TokenSpec.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.cardinality -import org.neo4j.cypher.internal.util.v3_5.{InternalException, LabelId, NameId, RelTypeId} +import org.opencypher.v9_0.util.{InternalException, LabelId, NameId, RelTypeId} sealed trait TokenSpec[+ID <: NameId] { def id: Option[ID] diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/assumeIndependence/AssumeIndependenceQueryGraphCardinalityModel.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/assumeIndependence/AssumeIndependenceQueryGraphCardinalityModel.scala index 91db502b44b14..2e1e879469750 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/assumeIndependence/AssumeIndependenceQueryGraphCardinalityModel.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/assumeIndependence/AssumeIndependenceQueryGraphCardinalityModel.scala @@ -21,11 +21,11 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.cardinality.assu import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics.{QueryGraphCardinalityModel, QueryGraphSolverInput} import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.cardinality.{ExpressionSelectivityCalculator, SelectivityCombiner} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5.{QueryGraph, _} import org.neo4j.cypher.internal.planner.v3_5.spi.GraphStatistics -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, Selectivity} -import org.neo4j.cypher.internal.v3_5.expressions.LabelName +import org.opencypher.v9_0.util.{Cardinality, Selectivity} +import org.opencypher.v9_0.expressions.LabelName case class AssumeIndependenceQueryGraphCardinalityModel(stats: GraphStatistics, combiner: SelectivityCombiner) extends QueryGraphCardinalityModel { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/assumeIndependence/PatternSelectivityCalculator.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/assumeIndependence/PatternSelectivityCalculator.scala index 3912646990b8f..1fa76917fd4fb 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/assumeIndependence/PatternSelectivityCalculator.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/assumeIndependence/PatternSelectivityCalculator.scala @@ -20,11 +20,11 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.cardinality.assumeIndependence import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.cardinality._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5.{Selections, _} import org.neo4j.cypher.internal.planner.v3_5.spi.GraphStatistics -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, LabelId, RelTypeId, Selectivity} -import org.neo4j.cypher.internal.v3_5.expressions.{LabelName, RelTypeName, SemanticDirection} +import org.opencypher.v9_0.util.{Cardinality, LabelId, RelTypeId, Selectivity} +import org.opencypher.v9_0.expressions.{LabelName, RelTypeName, SemanticDirection} trait Pattern2Selectivity { def apply(pattern: PatternRelationship, labels: Map[String, Set[LabelName]])(implicit semanticTable: SemanticTable, selections: Selections): Selectivity diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/debug/DebugPrinter.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/debug/DebugPrinter.scala index f4ef957a9275b..d623e2aa5e4a4 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/debug/DebugPrinter.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/debug/DebugPrinter.scala @@ -20,13 +20,14 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.debug import org.neo4j.cypher.internal.compiler.v3_5.phases.{CompilerContext, LogicalPlanState} -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.LOGICAL_PLANNING -import org.neo4j.cypher.internal.frontend.v3_5.phases.{CompilationPhaseTracer, Condition, Phase} -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.util.v3_5.attribution.SequentialIdGen -import org.neo4j.cypher.internal.v3_5.expressions.{ListLiteral, StringLiteral, Variable} +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.frontend.phases.{Condition, Phase} +import org.opencypher.v9_0.util.InputPosition +import org.opencypher.v9_0.util.attribution.SequentialIdGen +import org.opencypher.v9_0.expressions.{ListLiteral, StringLiteral, Variable} import org.neo4j.cypher.internal.v3_5.logical.plans.{Argument, LogicalPlan, ProduceResult, UnwindCollection} +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase.LOGICAL_PLANNING object DebugPrinter extends Phase[CompilerContext, LogicalPlanState, LogicalPlanState] { override def phase: CompilationPhaseTracer.CompilationPhase = LOGICAL_PLANNING diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/SingleComponentPlanner.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/SingleComponentPlanner.scala index 6e6ad2231a752..9268edb7c2718 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/SingleComponentPlanner.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/SingleComponentPlanner.scala @@ -26,10 +26,10 @@ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.idp.SingleComponentPlanner.planSinglePattern import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.idp.expandSolverStep.{planSinglePatternSide, planSingleProjectEndpoints} import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.leafPlanOptions -import org.neo4j.cypher.internal.frontend.v3_5.ast.RelationshipStartItem +import org.opencypher.v9_0.ast.RelationshipStartItem import org.neo4j.cypher.internal.ir.v3_5.{PatternRelationship, QueryGraph} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.util.InternalException import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan /** diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/cartesianProductsOrValueJoins.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/cartesianProductsOrValueJoins.scala index c0da1fcfe19d3..a54b160e4a016 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/cartesianProductsOrValueJoins.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/cartesianProductsOrValueJoins.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.idp import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{LogicalPlanningContext, QueryPlannerKit} -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.expressions.Expression import org.neo4j.cypher.internal.ir.v3_5.QueryGraph import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} import org.neo4j.cypher.internal.v3_5.logical.plans.{IndexLeafPlan, LogicalPlan} diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/expandSolverStep.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/expandSolverStep.scala index bbfd85cb5af22..4bfedef2d527e 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/expandSolverStep.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/expandSolverStep.scala @@ -23,7 +23,7 @@ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.LogicalPlanningCo import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Solveds import org.neo4j.cypher.internal.v3_5.logical.plans.{ExpandAll, ExpandInto, LogicalPlan} -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ case class expandSolverStep(qg: QueryGraph) extends IDPSolverStep[PatternRelationship, LogicalPlan, LogicalPlanningContext] { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/extractPredicates.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/extractPredicates.scala index c638184ac5816..cfae7367a851d 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/extractPredicates.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/extractPredicates.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.idp -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.{Rewriter, bottomUp} +import org.opencypher.v9_0.expressions._ object extractPredicates { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/patternExpressionRewriter.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/patternExpressionRewriter.scala index 7eaec451d75cf..f49c3bf3d3e90 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/patternExpressionRewriter.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/patternExpressionRewriter.scala @@ -19,13 +19,12 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical -import org.neo4j.cypher.internal.frontend.v3_5.IdentityMap -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.projectNamedPaths import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.Foldable._ -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, topDown} -import org.neo4j.cypher.internal.v3_5.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans.NestedPlanExpression +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.rewriting.rewriters.projectNamedPaths +import org.opencypher.v9_0.util.Foldable._ +import org.opencypher.v9_0.util.{IdentityMap, Rewriter, topDown} /* Rewrite pattern expressions and pattern comprehensions to nested plan expressions by planning them using the given context. diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/Sargable.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/Sargable.scala index 256735db490ba..08fda683e6fa2 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/Sargable.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/Sargable.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans import org.neo4j.cypher.internal.v3_5.logical.plans._ -import org.neo4j.cypher.internal.v3_5.expressions._ -import org.neo4j.cypher.internal.v3_5.functions +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.expressions.functions object WithSeekableArgs { def unapply(v: Any) = v match { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/LogicalPlanRewriter.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/LogicalPlanRewriter.scala index 1c6b7bc42f386..adec1dbbcb7f9 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/LogicalPlanRewriter.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/LogicalPlanRewriter.scala @@ -20,15 +20,14 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter import org.neo4j.cypher.internal.compiler.v3_5.phases.{CompilerContext, LogicalPlanState} -import org.neo4j.cypher.internal.frontend.v3_5.helpers.fixedPoint -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.RewriterStepSequencer -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.LOGICAL_PLANNING -import org.neo4j.cypher.internal.frontend.v3_5.phases.{Condition, Phase} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.Rewriter -import org.neo4j.cypher.internal.util.v3_5.attribution.Attributes - +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase.LOGICAL_PLANNING +import org.opencypher.v9_0.frontend.phases.{Condition, Phase} +import org.opencypher.v9_0.rewriting.RewriterStepSequencer +import org.opencypher.v9_0.util.Rewriter +import org.opencypher.v9_0.util.attribution.Attributes +import org.opencypher.v9_0.util.helpers.fixedPoint /* * Rewriters that live here are required to adhere to the contract of * receiving a valid plan and producing a valid plan. It should be possible diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/cleanUpEager.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/cleanUpEager.scala index 23f6c846e1b05..56c25be62d2c1 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/cleanUpEager.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/cleanUpEager.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Solveds -import org.neo4j.cypher.internal.util.v3_5.attribution.{Attributes, SameId} -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} +import org.opencypher.v9_0.util.attribution.{Attributes, SameId} +import org.opencypher.v9_0.util.{Rewriter, bottomUp} import org.neo4j.cypher.internal.v3_5.logical.plans.{Eager, Limit, LoadCSV, UnwindCollection} case class cleanUpEager(solveds: Solveds, attributes: Attributes) extends Rewriter { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/fuseSelections.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/fuseSelections.scala index 744e24f1fdaef..d4111b90fb308 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/fuseSelections.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/fuseSelections.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter -import org.neo4j.cypher.internal.util.v3_5.attribution.SameId +import org.opencypher.v9_0.util.attribution.SameId import org.neo4j.cypher.internal.v3_5.logical.plans.Selection -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} +import org.opencypher.v9_0.util.{Rewriter, bottomUp} case object fuseSelections extends Rewriter { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/predicateRemovalThroughJoins.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/predicateRemovalThroughJoins.scala index b0cc379cb1f7e..a7f3e76026b3e 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/predicateRemovalThroughJoins.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/predicateRemovalThroughJoins.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.util.{Rewriter, bottomUp} +import org.opencypher.v9_0.expressions.Expression import org.neo4j.cypher.internal.ir.v3_5.QueryGraph import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.attribution.{Attributes, SameId} +import org.opencypher.v9_0.util.attribution.{Attributes, SameId} import org.neo4j.cypher.internal.v3_5.logical.plans.{NodeHashJoin, Selection} /* diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/pruningVarExpander.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/pruningVarExpander.scala index 3275b3444f74d..af87991d968d0 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/pruningVarExpander.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/pruningVarExpander.scala @@ -20,10 +20,10 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter import org.neo4j.cypher.internal.v3_5.logical.plans._ -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, topDown} +import org.opencypher.v9_0.util.{Rewriter, topDown} import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans._ -import org.neo4j.cypher.internal.util.v3_5.attribution.SameId -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, FunctionInvocation} +import org.opencypher.v9_0.util.attribution.SameId +import org.opencypher.v9_0.expressions.{Expression, FunctionInvocation} import scala.collection.mutable diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/removeIdenticalPlans.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/removeIdenticalPlans.scala index 7eef0e538c41e..fc0a27835561e 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/removeIdenticalPlans.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/removeIdenticalPlans.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter -import org.neo4j.cypher.internal.util.v3_5.attribution.Attributes -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} +import org.opencypher.v9_0.util.attribution.Attributes +import org.opencypher.v9_0.util.{Rewriter, bottomUp} import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan import scala.collection.mutable diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/simplifyPredicates.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/simplifyPredicates.scala index 31da8206e8d54..67612ebfc87d9 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/simplifyPredicates.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/simplifyPredicates.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.v3_5.expressions.{AndedPropertyInequalities, Equals, In, ListLiteral} +import org.opencypher.v9_0.util.{Rewriter, bottomUp} +import org.opencypher.v9_0.expressions.{AndedPropertyInequalities, Equals, In, ListLiteral} case object simplifyPredicates extends Rewriter { override def apply(input: AnyRef) = instance.apply(input) diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/simplifySelections.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/simplifySelections.scala index 47a031c932620..e5d5d25344f07 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/simplifySelections.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/simplifySelections.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter -import org.neo4j.cypher.internal.util.v3_5.attribution.SameId -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.attribution.SameId +import org.opencypher.v9_0.util.{Rewriter, bottomUp} +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans._ /** diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/unnestApply.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/unnestApply.scala index 7f40fead79489..6f450ac8367d4 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/unnestApply.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/unnestApply.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Solveds -import org.neo4j.cypher.internal.util.v3_5.attribution.{Attributes, SameId} -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, topDown} +import org.opencypher.v9_0.util.attribution.{Attributes, SameId} +import org.opencypher.v9_0.util.{Rewriter, topDown} import org.neo4j.cypher.internal.v3_5.logical.plans._ case class unnestApply(solveds: Solveds, attributes: Attributes) extends Rewriter { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/unnestOptional.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/unnestOptional.scala index ab06c2502820e..3338632d7d4d2 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/unnestOptional.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/unnestOptional.scala @@ -19,16 +19,16 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter -import org.neo4j.cypher.internal.util.v3_5.attribution.{IdGen, SameId} -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.util.attribution.{IdGen, SameId} +import org.opencypher.v9_0.util.{Rewriter, bottomUp} +import org.opencypher.v9_0.expressions.Expression import org.neo4j.cypher.internal.v3_5.logical.plans._ case object unnestOptional extends Rewriter { override def apply(input: AnyRef) = if (isSafe(input)) instance.apply(input) else input - import org.neo4j.cypher.internal.util.v3_5.Foldable._ + import org.opencypher.v9_0.util.Foldable._ /* * It is not safe to unnest an optional expand with when we have diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/useTop.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/useTop.scala index 0dff3ede15591..1f04a9939d556 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/useTop.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/useTop.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter -import org.neo4j.cypher.internal.util.v3_5.attribution.SameId +import org.opencypher.v9_0.util.attribution.SameId import org.neo4j.cypher.internal.v3_5.logical.plans.{DoNotIncludeTies, Limit, Sort, Top} -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} +import org.opencypher.v9_0.util.{Rewriter, bottomUp} /** * When doing ORDER BY c1,c2,...,cn LIMIT e, we don't have to sort the full result in one go diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/AbstractIndexSeekLeafPlanner.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/AbstractIndexSeekLeafPlanner.scala index 7736d390cea6f..bdaad1dc4f805 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/AbstractIndexSeekLeafPlanner.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/AbstractIndexSeekLeafPlanner.scala @@ -22,15 +22,14 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.LeafPlansForVariable.maybeLeafPlans import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{LeafPlanFromExpressions, LeafPlanner, LeafPlansForVariable, LogicalPlanningContext} -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.notification.IndexLookupUnfulfillableNotification -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5.QueryGraph import org.neo4j.cypher.internal.planner.v3_5.spi.IndexDescriptor import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.LabelId +import org.opencypher.v9_0.util.{IndexLookupUnfulfillableNotification, LabelId} import org.neo4j.cypher.internal.v3_5.logical.plans._ -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ abstract class AbstractIndexSeekLeafPlanner extends LeafPlanner with LeafPlanFromExpressions { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/DynamicPropertyNotifier.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/DynamicPropertyNotifier.scala index 07b2357ac3142..2d3976c27c905 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/DynamicPropertyNotifier.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/DynamicPropertyNotifier.scala @@ -20,9 +20,9 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.LogicalPlanningContext -import org.neo4j.cypher.internal.frontend.v3_5.notification.InternalNotification import org.neo4j.cypher.internal.ir.v3_5.QueryGraph -import org.neo4j.cypher.internal.v3_5.expressions.{LabelName, Variable} +import org.opencypher.v9_0.expressions.{LabelName, Variable} +import org.opencypher.v9_0.util.InternalNotification object DynamicPropertyNotifier { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/IndexSeekLeafPlanner.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/IndexSeekLeafPlanner.scala index cb9aeaea96537..a502c0fdb02f5 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/IndexSeekLeafPlanner.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/IndexSeekLeafPlanner.scala @@ -20,10 +20,10 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps import org.neo4j.cypher.internal.compiler.v3_5.planner.logical._ -import org.neo4j.cypher.internal.frontend.v3_5.ast._ +import org.opencypher.v9_0.ast._ import org.neo4j.cypher.internal.planner.v3_5.spi.IndexDescriptor import org.neo4j.cypher.internal.v3_5.logical.plans.{LogicalPlan, QueryExpression} -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, LabelToken, PropertyKeyToken} +import org.opencypher.v9_0.expressions.{Expression, LabelToken, PropertyKeyToken} object indexSeekLeafPlanner extends AbstractIndexSeekLeafPlanner { protected def constructPlan(idName: String, diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/LogicalPlanProducer.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/LogicalPlanProducer.scala index 2ebadcd8d7049..80eac5f47e3d1 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/LogicalPlanProducer.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/LogicalPlanProducer.scala @@ -24,13 +24,13 @@ import org.neo4j.cypher.internal.compiler.v3_5.helpers.ListSupport import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.LogicalPlanningContext import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics.CardinalityModel -import org.neo4j.cypher.internal.frontend.v3_5.ast -import org.neo4j.cypher.internal.frontend.v3_5.ast._ +import org.opencypher.v9_0.ast +import org.opencypher.v9_0.ast._ import org.neo4j.cypher.internal.ir.v3_5._ -import org.neo4j.cypher.internal.util.v3_5.attribution.{Attributes, IdGen} -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.util.v3_5.{ExhaustiveShortestPathForbiddenException, InternalException} -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.attribution.{Attributes, IdGen} +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.util.{ExhaustiveShortestPathForbiddenException, InternalException} +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans.{DeleteExpression => DeleteExpressionPlan, Limit => LimitPlan, LoadCSV => LoadCSVPlan, Skip => SkipPlan, _} /* diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/OrLeafPlanner.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/OrLeafPlanner.scala index 4f805d3cc3441..8978a9dfab1f1 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/OrLeafPlanner.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/OrLeafPlanner.scala @@ -21,11 +21,11 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps import org.neo4j.cypher.internal.compiler.v3_5.planner.logical._ import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan -import org.neo4j.cypher.internal.frontend.v3_5.helpers.SeqCombiner.combine +import org.opencypher.v9_0.frontend.helpers.SeqCombiner.combine import org.neo4j.cypher.internal.ir.v3_5.{QueryGraph, Selections} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.v3_5.expressions.PartialPredicate.PartialPredicateWrapper -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, Ors} +import org.opencypher.v9_0.expressions.PartialPredicate.PartialPredicateWrapper +import org.opencypher.v9_0.expressions.{Expression, Ors} case class OrLeafPlanner(inner: Seq[LeafPlanFromExpressions]) extends LeafPlanner { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/PatternExpressionSolver.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/PatternExpressionSolver.scala index 571f88029e92e..d7640b07c5630 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/PatternExpressionSolver.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/PatternExpressionSolver.scala @@ -19,14 +19,14 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps -import org.neo4j.cypher.internal.util.v3_5.{FreshIdNameGenerator, Rewriter, UnNamedNameGenerator, topDown} +import org.opencypher.v9_0.util.{FreshIdNameGenerator, Rewriter, UnNamedNameGenerator, topDown} import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{LogicalPlanningContext, patternExpressionRewriter} -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.{PatternExpressionPatternElementNamer, projectNamedPaths} +import org.opencypher.v9_0.rewriting.rewriters.{PatternExpressionPatternElementNamer, projectNamedPaths} import org.neo4j.cypher.internal.ir.v3_5.QueryGraph import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan -import org.neo4j.cypher.internal.v3_5.expressions._ -import org.neo4j.cypher.internal.v3_5.functions.Exists +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.expressions.functions.Exists import scala.collection.mutable import scala.reflect.ClassTag diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/countStorePlanner.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/countStorePlanner.scala index 1d82c0dcea447..8a0b33b5727db 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/countStorePlanner.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/countStorePlanner.scala @@ -22,9 +22,9 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.LogicalPlanningContext import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection.{INCOMING, OUTGOING} -import org.neo4j.cypher.internal.v3_5.expressions._ -import org.neo4j.cypher.internal.v3_5.functions +import org.opencypher.v9_0.expressions.SemanticDirection.{INCOMING, OUTGOING} +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.expressions.functions import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan case object countStorePlanner { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/getDegreeRewriter.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/getDegreeRewriter.scala index 1d38c5bdb62f4..e41544fd47463 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/getDegreeRewriter.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/getDegreeRewriter.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.frontend.v3_5.helpers.calculateUsingGetDegree -import org.neo4j.cypher.internal.v3_5.expressions._ -import org.neo4j.cypher.internal.v3_5.functions +import org.opencypher.v9_0.util.{Rewriter, bottomUp} +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.expressions.functions import org.neo4j.cypher.internal.v3_5.logical.plans.NestedPlanExpression +import org.opencypher.v9_0.rewriting.rewriters.calculateUsingGetDegree case object getDegreeRewriter extends Rewriter { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/idSeekLeafPlanner.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/idSeekLeafPlanner.scala index 6647e4bfe89d5..2d1a22c597ae6 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/idSeekLeafPlanner.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/idSeekLeafPlanner.scala @@ -24,8 +24,8 @@ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans._ import org.neo4j.cypher.internal.ir.v3_5.{PatternRelationship, QueryGraph} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} import org.neo4j.cypher.internal.v3_5.logical.plans.{LogicalPlan, SeekableArgs} -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection.{BOTH, INCOMING, OUTGOING} -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions.SemanticDirection.{BOTH, INCOMING, OUTGOING} +import org.opencypher.v9_0.expressions._ object idSeekLeafPlanner extends LeafPlanner with LeafPlanFromExpression { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/indexScanLeafPlanner.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/indexScanLeafPlanner.scala index 8f67f386af805..9b6440bf61dcb 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/indexScanLeafPlanner.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/indexScanLeafPlanner.scala @@ -22,12 +22,12 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.LeafPlansForVariable.maybeLeafPlans import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{LeafPlanFromExpression, LeafPlanner, LeafPlansForVariable, LogicalPlanningContext} -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.notification.IndexLookupUnfulfillableNotification +import org.opencypher.v9_0.ast._ import org.neo4j.cypher.internal.ir.v3_5.QueryGraph import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} import org.neo4j.cypher.internal.v3_5.logical.plans.{AsDynamicPropertyNonScannable, AsStringRangeNonSeekable, LogicalPlan} -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.util.IndexLookupUnfulfillableNotification object indexScanLeafPlanner extends LeafPlanner with LeafPlanFromExpression { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/labelScanLeafPlanner.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/labelScanLeafPlanner.scala index 687943fcb0a0e..67639c3ee07a3 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/labelScanLeafPlanner.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/labelScanLeafPlanner.scala @@ -20,10 +20,10 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{LeafPlanFromExpression, LeafPlanner, LeafPlansForVariable, LogicalPlanningContext} -import org.neo4j.cypher.internal.frontend.v3_5.ast.UsingScanHint +import org.opencypher.v9_0.ast.UsingScanHint import org.neo4j.cypher.internal.ir.v3_5.QueryGraph import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, HasLabels, Variable} +import org.opencypher.v9_0.expressions.{Expression, HasLabels, Variable} object labelScanLeafPlanner extends LeafPlanner with LeafPlanFromExpression { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/mergeUniqueIndexSeekLeafPlanner.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/mergeUniqueIndexSeekLeafPlanner.scala index d60039c98693e..7ec62161074ac 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/mergeUniqueIndexSeekLeafPlanner.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/mergeUniqueIndexSeekLeafPlanner.scala @@ -20,12 +20,12 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{LeafPlansForVariable, LogicalPlanningContext} -import org.neo4j.cypher.internal.frontend.v3_5.ast._ +import org.opencypher.v9_0.ast._ import org.neo4j.cypher.internal.ir.v3_5.QueryGraph import org.neo4j.cypher.internal.planner.v3_5.spi.IndexDescriptor import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} import org.neo4j.cypher.internal.v3_5.logical.plans.{LogicalPlan, QueryExpression} -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, LabelToken, PropertyKeyToken} +import org.opencypher.v9_0.expressions.{Expression, LabelToken, PropertyKeyToken} /* * Plan the following type of plan diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/planShortestPaths.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/planShortestPaths.scala index 50bac0b9fe272..d1e53760a1390 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/planShortestPaths.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/planShortestPaths.scala @@ -21,13 +21,12 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.LogicalPlanningContext import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.idp.expandSolverStep -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.projectNamedPaths -import org.neo4j.cypher.internal.frontend.v3_5.notification.ExhaustiveShortestPathForbiddenNotification +import org.opencypher.v9_0.rewriting.rewriters.projectNamedPaths import org.neo4j.cypher.internal.ir.v3_5.{Predicate, ShortestPathPattern, _} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Solveds -import org.neo4j.cypher.internal.util.v3_5.{ExhaustiveShortestPathForbiddenException, FreshIdNameGenerator, InternalException} -import org.neo4j.cypher.internal.v3_5.expressions._ -import org.neo4j.cypher.internal.v3_5.functions.{Length, Nodes} +import org.opencypher.v9_0.util.{ExhaustiveShortestPathForbiddenException, ExhaustiveShortestPathForbiddenNotification, FreshIdNameGenerator, InternalException} +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.expressions.functions.{Length, Nodes} import org.neo4j.cypher.internal.v3_5.logical.plans.{Ascending, DoNotIncludeTies, IncludeTies, LogicalPlan} case object planShortestPaths { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/projection.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/projection.scala index e61f811eb1cd2..541ece585c7a1 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/projection.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/projection.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.LogicalPlanningContext -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, Variable} +import org.opencypher.v9_0.expressions.{Expression, Variable} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/selectHasLabelWithJoin.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/selectHasLabelWithJoin.scala index 7b2b5ef47dadb..09aba1fd645e4 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/selectHasLabelWithJoin.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/selectHasLabelWithJoin.scala @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.compiler.v3_5.planner.unsolvedPreds import org.neo4j.cypher.internal.ir.v3_5.QueryGraph import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan -import org.neo4j.cypher.internal.v3_5.expressions.{HasLabels, Variable} +import org.opencypher.v9_0.expressions.{HasLabels, Variable} case object selectHasLabelWithJoin extends CandidateGenerator[LogicalPlan] { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/selectPatternPredicates.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/selectPatternPredicates.scala index ae987f9e5f86c..72bd1867f7b89 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/selectPatternPredicates.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/selectPatternPredicates.scala @@ -23,8 +23,8 @@ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical._ import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan import org.neo4j.cypher.internal.ir.v3_5.QueryGraph import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.FreshIdNameGenerator -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.FreshIdNameGenerator +import org.opencypher.v9_0.expressions._ case object selectPatternPredicates extends CandidateGenerator[LogicalPlan] { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/solveOptionalMatches.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/solveOptionalMatches.scala index 864ad3b232112..5c9a079a7a207 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/solveOptionalMatches.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/solveOptionalMatches.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.solveOptionalMatches.OptionalSolver import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.LogicalPlanningContext -import org.neo4j.cypher.internal.frontend.v3_5.ast.UsingJoinHint +import org.opencypher.v9_0.ast.UsingJoinHint import org.neo4j.cypher.internal.ir.v3_5.QueryGraph import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/sortSkipAndLimit.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/sortSkipAndLimit.scala index a25167da8477e..0a0c4109b55d3 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/sortSkipAndLimit.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/sortSkipAndLimit.scala @@ -19,13 +19,13 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.util.InternalException import org.neo4j.cypher.internal.compiler.v3_5.planner.logical._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.{AscSortItem, DescSortItem, SortItem} +import org.opencypher.v9_0.ast.{AscSortItem, DescSortItem, SortItem} import org.neo4j.cypher.internal.v3_5.logical.plans.{Ascending, ColumnOrder, Descending, LogicalPlan} import org.neo4j.cypher.internal.ir.v3_5.{PlannerQuery, QueryProjection} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, Variable} +import org.opencypher.v9_0.expressions.{Expression, Variable} object sortSkipAndLimit extends PlanTransformer[PlannerQuery] { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/triadicSelectionFinder.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/triadicSelectionFinder.scala index cd898f3faf016..2bf614f53626a 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/triadicSelectionFinder.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/triadicSelectionFinder.scala @@ -22,8 +22,8 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{CandidateGenerator, LogicalPlanningContext} import org.neo4j.cypher.internal.ir.v3_5.QueryGraph import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.attribution.SameId -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.attribution.SameId +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans.{Expand, ExpandAll, LogicalPlan, Selection} object triadicSelectionFinder extends CandidateGenerator[LogicalPlan] { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/uniqueIndexSeekLeafPlanner.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/uniqueIndexSeekLeafPlanner.scala index 27c0dc43c7dcc..b6a423cb6ec2d 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/uniqueIndexSeekLeafPlanner.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/uniqueIndexSeekLeafPlanner.scala @@ -20,9 +20,9 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.LogicalPlanningContext -import org.neo4j.cypher.internal.frontend.v3_5.ast.UsingIndexHint +import org.opencypher.v9_0.ast.UsingIndexHint import org.neo4j.cypher.internal.planner.v3_5.spi.IndexDescriptor -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, LabelToken, PropertyKeyToken} +import org.opencypher.v9_0.expressions.{Expression, LabelToken, PropertyKeyToken} import org.neo4j.cypher.internal.v3_5.logical.plans.{LogicalPlan, QueryExpression} object uniqueIndexSeekLeafPlanner extends AbstractIndexSeekLeafPlanner { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/verifyBestPlan.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/verifyBestPlan.scala index a6267711b4b1d..511c267064e41 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/verifyBestPlan.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/verifyBestPlan.scala @@ -20,14 +20,13 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{LogicalPlanningContext, PlanTransformer} -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.notification.{IndexHintUnfulfillableNotification, JoinHintUnfulfillableNotification} import org.neo4j.cypher.internal.ir.v3_5.PlannerQuery import org.neo4j.cypher.internal.planner.v3_5.spi.PlanContext import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5._ -import org.neo4j.cypher.internal.v3_5.expressions.LabelName import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.expressions.LabelName +import org.opencypher.v9_0.util._ object verifyBestPlan extends PlanTransformer[PlannerQuery] { def apply(plan: LogicalPlan, expected: PlannerQuery, context: LogicalPlanningContext, solveds: Solveds, cardinalities: Cardinalities): LogicalPlan = { diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/prettifier/Prettifier.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/prettifier/Prettifier.scala index 461e3da47ab1a..078e9a88fd556 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/prettifier/Prettifier.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/prettifier/Prettifier.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.prettifier -import org.neo4j.cypher.internal.util.v3_5.SyntaxException -import org.neo4j.cypher.internal.frontend.v3_5.parser.{Base, Strings} +import org.opencypher.v9_0.parser.{Base, Strings} +import org.opencypher.v9_0.util.SyntaxException import org.parboiled.scala._ import scala.collection.mutable diff --git a/community/cypher/cypher-planner-3.5/src/test/java/org/neo4j/cypher/internal/compiler/v3_5/common/CypherOrderabilityTest.java b/community/cypher/cypher-planner-3.5/src/test/java/org/neo4j/cypher/internal/compiler/v3_5/common/CypherOrderabilityTest.java index 890347f5b864a..94ecaea55f2cd 100644 --- a/community/cypher/cypher-planner-3.5/src/test/java/org/neo4j/cypher/internal/compiler/v3_5/common/CypherOrderabilityTest.java +++ b/community/cypher/cypher-planner-3.5/src/test/java/org/neo4j/cypher/internal/compiler/v3_5/common/CypherOrderabilityTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.HashMap; -import org.neo4j.cypher.internal.util.v3_5.IncomparableValuesException; +import org.opencypher.v9_0.util.IncomparableValuesException; import org.neo4j.kernel.impl.util.ValueUtils; import org.neo4j.values.virtual.VirtualValues; diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/IdentityMapTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/IdentityMapTest.scala deleted file mode 100644 index 943381363e2c8..0000000000000 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/IdentityMapTest.scala +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * This file is part of Neo4j. - * - * Neo4j is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.neo4j.cypher.internal.compiler.v3_5 - -import org.neo4j.cypher.internal.frontend.v3_5.IdentityMap -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite - -class IdentityMapTest extends CypherFunSuite { - - case class Val() - - test("should store and retrieve based on object identity") { - val x = Val() - val y = Val() - assert(x === y) - - val map = IdentityMap(x -> "x", y -> "y") - assert(map.get(x) === Some("x")) - assert(map.get(y) === Some("y")) - } - - test("should not overwrite equal key") { - val x = Val() - val y = Val() - assert(x === y) - - val map = IdentityMap(x -> "x") - val updatedMap = map.updated(y, "y") - assert(updatedMap.get(x) === Some("x")) - assert(updatedMap.get(y) === Some("y")) - } - - test("should overwrite eq key") { - val x = Val() - val map = IdentityMap(x -> "x") - val updatedMap = map.updated(x, "x'") - assert(updatedMap.get(x) === Some("x'")) - } - - test("should be immutable when updating") { - val x = Val() - val y = Val() - val map = IdentityMap(x -> "x") - val updatedMap = map.updated(x, "x'").updated(y, "y") - assert(map.get(x) === Some("x")) - assert(map.get(y) === None) - assert(updatedMap.get(x) === Some("x'")) - assert(updatedMap.get(y) === Some("y")) - } - - test("should know contained keys") { - val k1 = Val() - val k2 = Val() - val map = IdentityMap(k1 -> "x") - - assert(map.contains(k1)) - assert(!map.contains(k2)) - } -} diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/InputPositionTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/InputPositionTest.scala deleted file mode 100644 index c208a6d3ca6a9..0000000000000 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/InputPositionTest.scala +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * This file is part of Neo4j. - * - * Neo4j is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.neo4j.cypher.internal.compiler.v3_5 - -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite - -class InputPositionTest extends CypherFunSuite { - - test("should bump the input position") { - val pos = InputPosition(2, 1, 1) - - val bumped = pos.bumped() - - bumped.offset should equal(pos.offset + 1) - bumped.column should equal(pos.column) - bumped.line should equal(pos.line) - - pos should not equal bumped - pos should equal(InputPosition(2, 1, 1)) - bumped should equal(InputPosition(2, 1, 1).bumped()) - } - - test("should print offset") { - InputPosition(2, 1, 1).toOffsetString should equal("2") - InputPosition(2, 1, 1).bumped().toOffsetString should equal("3") - } -} diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/NotImplementedPlanContext.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/NotImplementedPlanContext.scala index e0d5556c83d74..e3f854b855f32 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/NotImplementedPlanContext.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/NotImplementedPlanContext.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.compiler.v3_5 -import org.neo4j.cypher.internal.frontend.v3_5.phases.InternalNotificationLogger +import org.opencypher.v9_0.frontend.phases.InternalNotificationLogger import org.neo4j.cypher.internal.planner.v3_5.spi.{GraphStatistics, IndexDescriptor, PlanContext} import org.neo4j.cypher.internal.v3_5.logical.plans.{ProcedureSignature, QualifiedName, UserFunctionSignature} diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/RewriteProcedureCallsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/RewriteProcedureCallsTest.scala index ab4bacb507a3c..304539d6c4464 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/RewriteProcedureCallsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/RewriteProcedureCallsTest.scala @@ -20,10 +20,10 @@ package org.neo4j.cypher.internal.compiler.v3_5 import org.neo4j.cypher.internal.compiler.v3_5.phases.RewriteProcedureCalls -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.{Namespace, ProcedureName} +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.{Namespace, ProcedureName} import org.neo4j.cypher.internal.v3_5.logical.plans._ class RewriteProcedureCallsTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ScopeTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ScopeTest.scala deleted file mode 100644 index 4da009bc0af0d..0000000000000 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ScopeTest.scala +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * This file is part of Neo4j. - * - * Neo4j is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.neo4j.cypher.internal.compiler.v3_5 - -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite - -class ScopeTest extends CypherFunSuite { - - import org.neo4j.cypher.internal.compiler.v3_5.helpers.ScopeTestHelper._ - - test("Should retrieve local symbol definitions") { - val given = scope( - intSymbol("a", 9, 45), - intSymbol("b", 28, 49) - )() - - given.symbolDefinitions should equal(Set(symUse("a", 9), symUse("b", 28))) - } - - test("Should find all scopes") { - val child11 = scope(stringSymbol("name", 31, 93), nodeSymbol("root", 6, 69), nodeSymbol("tag", 83), nodeSymbol("book", 18, 111))() - val child1 = scope(nodeSymbol("root", 6), nodeSymbol("book", 18, 124))(child11) - val child2 = scope(nodeSymbol("book", 18, 124))() - val given = scope()(child1, child2) - - given.allScopes should equal(Seq(given, child1, child11, child2)) - } - - test("Should find all definitions") { - val child11 = scope(stringSymbol("name", 31, 93), nodeSymbol("root", 6, 69), nodeSymbol("tag", 83), nodeSymbol("book", 18, 111))() - val child1 = scope(nodeSymbol("root", 6), nodeSymbol("book", 24, 124))(child11) - val child2 = scope(nodeSymbol("book", 18, 124))() - val given = scope()(child1, child2) - - given.allSymbolDefinitions should equal(Map( - "name" -> Set(symUse("name", 31)), - "root" -> Set(symUse("root", 6)), - "tag" -> Set(symUse("tag", 83)), - "book" -> Set(symUse("book", 18), symUse("book", 24)) - )) - } - - test("Should build variable map for simple scope tree") { - val given = scope(nodeSymbol("a", 1, 2), nodeSymbol("b", 2))() - - val actual = given.variableDefinitions - - actual should equal(Map( - symUse("a", 1) -> symUse("a", 1), - symUse("a", 2) -> symUse("a", 1), - symUse("b", 2) -> symUse("b", 2) - )) - } - - test("Should build variable map for complex scope tree with shadowing") { - val given = scope()( - scope(nodeSymbol("root", 6), nodeSymbol("book", 18, 111))( - scope(stringSymbol("name", 31, 93), nodeSymbol("root", 6, 69), nodeSymbol("tag", 83), nodeSymbol("book", 18, 124))() - ), - scope(nodeSymbol("book", 200, 300))() - ) - - val actual = given.allVariableDefinitions - - actual should equal(Map( - symUse("root", 6) -> symUse("root", 6), - symUse("root", 69) -> symUse("root", 6), - symUse("book", 18) -> symUse("book", 18), - symUse("book", 111) -> symUse("book", 18), - symUse("book", 124) -> symUse("book", 18), - symUse("book", 200) -> symUse("book", 200), - symUse("book", 300) -> symUse("book", 200), - symUse("name", 31) -> symUse("name", 31), - symUse("name", 93) -> symUse("name", 31), - symUse("tag", 83) -> symUse("tag", 83) - )) - } -} diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ScopeTreeTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ScopeTreeTest.scala deleted file mode 100644 index adb179e2a6795..0000000000000 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ScopeTreeTest.scala +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * This file is part of Neo4j. - * - * Neo4j is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.neo4j.cypher.internal.compiler.v3_5 - -import org.neo4j.cypher.internal.compiler.v3_5.parser.ParserFixture.parse -import org.neo4j.cypher.internal.frontend.v3_5.helpers.StatementHelper._ -import org.neo4j.cypher.internal.util.v3_5.symbols.TypeSpec -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite - -class ScopeTreeTest extends CypherFunSuite { - - import org.neo4j.cypher.internal.compiler.v3_5.helpers.ScopeTestHelper._ - - /* - * NOTE: when computing the scopeTree the normalization of return and with clauses has already taken place, so when - * writing tests here please remember to add always aliases in return and with clauses. - */ - - //////00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222223333333333444444444455555555556666666666 - //////01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 - test("match (n)return n as m => { { match (n)return n } { return n as m } }") { - val ast = parse("match (n) return n as m") - val scopeTree = ast.scope - - scopeTree should equal(scope()( - scope(nodeSymbol("n", 7, 17))(), - scope(nodeSymbol("m", 22))() - )) - } - - //////00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222223333333333444444444455555555556666666666 - //////01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 - test("match (a) with a as b return b as b => { { match (a) with a } { as b return b } { return b as b } }") { - val ast = parse("match (a) with a as b return b as b") - val scopeTree = ast.scope - - scopeTree should equal(scope()( - scope(nodeSymbol("a", 7, 15))(), - scope(nodeSymbol("b", 20, 29))(), - scope(nodeSymbol("b", 20, 29, 34))() - )) - } - - //////00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222223333333333444444444455555555556666666666 - //////01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 - test("match (a) with a as a order by a.name limit 1 match a-->b return a as a => { { match (a) with a } { as a order by a.name limit 1 match a-->b return a } { return a as a } }") { - val ast = parse("match (a) with a as a order by a.name limit 1 match (a)-->(b) return a as a") - val scopeTree = ast.scope - - // TODO This looks suspicious; since we only use aliased items for variableNamespacing, it should be ok though - - // Would rewrite to match a6 with a13 order by a13.name limit 1 match a13-->b49 return a13 as a63, which is wrong - - scopeTree should equal(scope()( - scope(nodeSymbol("a", 7, 15))(), - scope( - nodeSymbol("a", 7, 15, 20, 31, 53, 69), - nodeSymbol("b", 59) - )(), - scope(nodeSymbol("a", 7, 15, 20, 31, 53, 69, 74))() - )) - } - - //////00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222223333333333444444444455555555556666666666 - //////01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 - test("match (a:Party) return a as a union match (a:Animal) return a as a => { { match (a:Party) return a } { } union { match (a:Animal) return a } { } }") { - val ast = parse("match (a:Party) return a as a union match (a:Animal) return a as a") - val scopeTree = ast.scope - - scopeTree should equal(scope()( - scope()( - scope(nodeSymbol("a", 7, 23))(), - scope(nodeSymbol("a", 7, 23, 28))() - ), - scope()( - scope(nodeSymbol("a", 43, 60))(), - scope(nodeSymbol("a", 43, 60, 65))() - ) - )) - } - - //////00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222223333333333444444444455555555556666666666 - //////01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 - test("match (a) with a as a where a:Foo with a as a return a as a => { { match (a) with a } { as a where a:Foo with a } { as a return a } { return a as a } }") { - val ast = parse("match (a) with a as a where a:Foo with a as a return a as a") - val scopeTree = ast.scope - - scopeTree should equal(scope()( - scope(nodeSymbol("a", 7, 15))(), - scope(nodeSymbol("a", 7, 15, 20, 28, 39))(), - scope(nodeSymbol("a", 7, 15, 20, 28, 39, 44, 53))(), - scope(nodeSymbol("a", 7, 15, 20, 28, 39, 44, 53, 58))() - )) - } - - //////00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222223333333333444444444455555555556666666666 - //////01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 - test("match (a) with a as a optional match (b) with b as b return b as b => { { match (a) with a } { as a optional match (b) with b } { as b return b } { return b as b } }") { - val ast = parse("match (a) with a as a optional match (b) with b as b return b as b") - val scopeTree = ast.scope - - scopeTree should equal(scope()( - scope(nodeSymbol("a", 7, 15))(), - scope( - nodeSymbol("a", 7, 15, 20), - nodeSymbol("b", 38, 46))(), - scope(nodeSymbol("b", 38, 46, 51, 60))(), - scope(nodeSymbol("b", 38, 46, 51, 60, 65))() - )) - } - - //////00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222223333333333444444444455555555556666666666 - //////01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 - test("return [ a in [1, 2, 3] | a ] as r => { { return { [ a in [1, 2, 3] | a ] } } { as r } }") { - val ast = parse("return [ a in [1, 2, 3] | a ] as r") - val scopeTree = ast.scope - - scopeTree should equal(scope()( - scope()( - scope(intSymbol("a", 9, 26))() - ), - scope(intCollectionSymbol("r", 33))() - )) - } - - //////00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222223333333333444444444455555555556666666666 - //////01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 - test("with 1 as c return [ a in [1, 2, 3] | a + c ] as r => { { with 1 } { as c return { [ a in [1, 2, 3] | a + c ] } } { } }") { - val ast = parse("with 1 as c return [ a in [1, 2, 3] | a + c ] as r") - val scopeTree = ast.scope - - scopeTree should equal(scope()( - scope()(), - scope( - intSymbol("c", 10))( - scope( - intSymbol("a", 21, 38), - intSymbol("c", 10, 42) - )() - ), - scope(intCollectionSymbol("r", 49))() - )) - } - - //////00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222223333333333444444444455555555556666666666 - //////01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 - test("return [ a in [1, 2, 3] | [ b in [4, 5, 6] | a + b ] ] as r => { { return { [ a in [1, 2, 3] | { [ b in [4, 5, 6] | a + b ] } ] } } { }") { - val ast = parse("return [ a in [1, 2, 3] | [ b in [4, 5, 6] | a + b ] ] as r") - val scopeTree = ast.scope - - scopeTree should equal(scope()( - scope()( - scope(intSymbol("a", 9))( - scope( - intSymbol("a", 9, 45), - intSymbol("b", 28, 49) - )() - ) - ), - scope(intCollectionCollectionSymbol("r", 58))() - )) - } - - //////00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222223333333333444444444455555555556666666666 - //////01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 - test("match (a) where not a-->() return a as a => { { match (a) where not a-->() return a } { return a as a } }") { - val ast = parse("match (a) where not (a)-->() return a as a") - val scopeTree = ast.scope - - scopeTree should equal(scope()( - scope(nodeSymbol("a", 7, 21, 36))(), - scope(nodeSymbol("a", 7, 21, 36, 41))() - )) - } - - //////00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222223333333333444444444455555555556666666666 - //////01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 - test("MATCH (liker) WITH liker AS `liker`, (liker)-[]-() AS isNew WITH isNew as `isNew`, liker.time AS `freshId` ORDER BY `freshId` RETURN isNew as `isNew`") { - val ast = parse("MATCH (liker) WITH liker AS `liker`, (liker)-[]-() AS isNew WITH isNew as `isNew`, liker.time AS `freshId` ORDER BY `freshId` RETURN isNew as `isNew`") - val scopeTree = ast.scope - - scopeTree should equal(scope()( - scope(nodeSymbol("liker", 7, 19, 38))(), - scope(pathCollectionSymbol("isNew", 54, 65), nodeSymbol("liker", 83, 19, 38, 7, 28))(), - scope(allSymbol("freshId", 97, 116), pathCollectionSymbol("isNew", 54, 65, 74, 133))(), - scope(pathCollectionSymbol("isNew", 54, 74, 65, 142, 133))() - )) - } - - //////00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222223333333333444444444455555555556666666666 - //////01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 - test("match n, x with n as x match n, x return n as n, x as x => { { match n, x with n } { with n as x match n, x return n, x } { return n, x } }") { - val ast = parse("match (n), (x) with n as x match (n), (x) return n as n, x as x") - val scopeTree = ast.scope - - scopeTree should equal(scope()( - scope(nodeSymbol("n", 7, 20), nodeSymbol("x", 12))(), - scope(nodeSymbol("n", 34, 49), nodeSymbol("x", 25, 39, 57))(), - scope(nodeSymbol("n", 34, 49, 54), nodeSymbol("x", 25, 39, 57, 62))() - )) - } - - //////00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222223333333333444444444455555555556666666666 - //////01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 - test("with 1 as p, count(*) as rng return p order by rng ==> { {} { with 1 as p, count(*) as rng return p } { order by rng } }") { - val ast = parse("with 1 as p, count(*) as rng return p order by rng") - - val actual = ast.scope - val expected = scope()( - scope()(), - scope(intSymbol("p", 10, 36), intSymbol("rng", 25))(), - scope(intSymbol("p", 10, 36, 37), typedSymbol("rng", TypeSpec.all, 25, 47))() - ) - - actual should equal(expected) - } -} - diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ScopeTreeVerificationTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ScopeTreeVerificationTest.scala deleted file mode 100644 index 0df078729100e..0000000000000 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ScopeTreeVerificationTest.scala +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * This file is part of Neo4j. - * - * Neo4j is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.neo4j.cypher.internal.compiler.v3_5 - -import org.neo4j.cypher.internal.frontend.v3_5.helpers.StringHelper._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ScopeTreeVerifier -import org.neo4j.cypher.internal.frontend.v3_5.semantics.Scope - -class ScopeTreeVerificationTest extends CypherFunSuite { - - import org.neo4j.cypher.internal.compiler.v3_5.helpers.ScopeTestHelper._ - - test("should reject scopes mapping the wrong name to a symbol") { - val given = Scope(Map("a" -> intSymbol("a", 3), "b" -> intSymbol("x", 5)), Seq()) - - val result = ScopeTreeVerifier.verify(given).map(_.fixNewLines) - - result should equal(Seq(s"""'b' points to symbol with different name 'x@5(5): Integer' in scope ${given.toIdString}. Scope tree: - |${given.toIdString} { - | a: 3 - | b: 5 - |} - |""".stripMargin.fixNewLines)) - } -} diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/SemanticCheckableTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/SemanticCheckableTest.scala deleted file mode 100644 index 93cbb148082bb..0000000000000 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/SemanticCheckableTest.scala +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * This file is part of Neo4j. - * - * Neo4j is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.neo4j.cypher.internal.compiler.v3_5 - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics._ -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.Variable - -class SemanticCheckableTest extends CypherFunSuite with SemanticAnalysisTooling { - - test("shouldChainSemanticCheckableFunctions") { - val state1 = SemanticState.clean - val error1 = SemanticError("an error", DummyPosition(0)) - val func1: SemanticCheck = s => SemanticCheckResult(state1, Seq(error1)) - - val state2 = SemanticState.clean - val error2 = SemanticError("another error", DummyPosition(0)) - val func2: SemanticCheck = s => { - s should equal(state1) - SemanticCheckResult(state2, Seq(error2)) - } - - val chain: SemanticCheck = func1 chain func2 - val result = chain(SemanticState.clean) - result.state should equal(state2) - result.errors should equal(Seq(error1, error2)) - } - - test("shouldChainSemanticFunctionReturningRightOfEither") { - val state1 = SemanticState.clean - val error1 = SemanticError("an error", DummyPosition(0)) - val func1: SemanticCheck = s => SemanticCheckResult(state1, Seq(error1)) - - val state2 = SemanticState.clean - val func2: SemanticState => Either[SemanticError, SemanticState] = s => Right(state2) - - val chain: SemanticCheck = func1 chain func2 - val result = chain(SemanticState.clean) - result.state should equal(state2) - result.errors should equal(Seq(error1)) - - val chain2: SemanticCheck = func2 chain func1 - val result2 = chain2(SemanticState.clean) - result2.state should equal(state2) - result2.errors should equal(Seq(error1)) - - val chain3: SemanticCheck = func2 chain func2 - val result3 = chain3(SemanticState.clean) - result3.state should equal(state2) - result3.errors shouldBe empty - } - - test("shouldChainSemanticFunctionReturningLeftOfEither") { - val state1 = SemanticState.clean - val error1 = SemanticError("an error", DummyPosition(0)) - val func1: SemanticCheck = s => SemanticCheckResult(state1, Seq(error1)) - - val error2 = SemanticError("another error", DummyPosition(0)) - val func2: SemanticState => Either[SemanticError, SemanticState] = s => Left(error2) - - val chain1: SemanticCheck = func1 chain func2 - val result = chain1(SemanticState.clean) - result.state should equal(state1) - result.errors should equal(Seq(error1, error2)) - - val chain2: SemanticCheck = func2 chain func1 - val result2 = chain2(SemanticState.clean) - result2.state should equal(state1) - result2.errors should equal(Seq(error2, error1)) - - val chain3: SemanticCheck = func2 chain func2 - val state3 = SemanticState.clean - val result3 = chain3(state3) - result3.state should equal(state3) - result3.errors should equal(Seq(error2, error2)) - } - - test("shouldChainSemanticFunctionReturningNone") { - val state1 = SemanticState.clean - val error1 = SemanticError("an error", DummyPosition(0)) - val func1: SemanticCheck = s => SemanticCheckResult(state1, Seq(error1)) - - val func2: SemanticState => Option[SemanticError] = s => None - - val chain1: SemanticCheck = func1 chain func2 - val result = chain1(SemanticState.clean) - result.state should equal(state1) - result.errors should equal(Seq(error1)) - - val chain2: SemanticCheck = func2 chain func1 - val result2 = chain2(SemanticState.clean) - result2.state should equal(state1) - result2.errors should equal(Seq(error1)) - - val chain3: SemanticCheck = func2 chain func2 - val state3 = SemanticState.clean - val result3 = chain3(state3) - result3.state should equal(state3) - result3.errors shouldBe empty - } - - test("shouldChainSemanticFunctionReturningSomeError") { - val state1 = SemanticState.clean - val error1 = SemanticError("an error", DummyPosition(0)) - val func1: SemanticCheck = s => SemanticCheckResult(state1, Seq(error1)) - - val error2 = SemanticError("another error", DummyPosition(0)) - val func2: SemanticState => Option[SemanticError] = s => Some(error2) - - val chain1: SemanticCheck = func1 chain func2 - val result = chain1(SemanticState.clean) - result.state should equal(state1) - result.errors should equal(Seq(error1, error2)) - - val chain2: SemanticCheck = func2 chain func1 - val result2 = chain2(SemanticState.clean) - result2.state should equal(state1) - result2.errors should equal(Seq(error2, error1)) - - val chain3: SemanticCheck = func2 chain func2 - val state3 = SemanticState.clean - val result3 = chain3(state3) - result3.state should equal(state3) - result3.errors should equal(Seq(error2, error2)) - } - - test("shouldChainSemanticCheckAfterNoErrorWithIfOkThen") { - val state1 = SemanticState.clean - val func1: SemanticCheck = s => SemanticCheckResult(state1, Seq()) - - val error2 = SemanticError("an error", DummyPosition(0)) - val func2: SemanticState => Option[SemanticError] = s => Some(error2) - - val chain: SemanticCheck = func1 chain func2 - val result = chain(SemanticState.clean) - result.state should equal(state1) - result.errors should equal(Seq(error2)) - } - - test("shouldNotChainSemanticFunctionAfterAnErrorWithIfOkThen") { - val state1 = SemanticState.clean - val error1 = SemanticError("an error", DummyPosition(0)) - val func1 = (s: SemanticState) => SemanticCheckResult(state1, Seq(error1)) - val func2: SemanticCheck = s => fail("Second check was incorrectly run") - - val chain: SemanticCheck = func1 ifOkChain func2 - val result = chain(SemanticState.clean) - result.state should equal(state1) - result.errors should equal(Seq(error1)) - } - - test("shouldEvaluateInnerCheckForTrueWhen") { - val state1 = SemanticState.clean - val error1 = SemanticError("an error", DummyPosition(0)) - val func1: SemanticCheck = s => SemanticCheckResult(state1, Seq(error1)) - - val error2 = SemanticError("another error", DummyPosition(0)) - val func2: SemanticState => Option[SemanticError] = s => Some(error2) - - val chain: SemanticCheck = func1 chain when(condition = true) { func2 } - val result = chain(SemanticState.clean) - result.state should equal(state1) - result.errors should equal(Seq(error1, error2)) - } - - test("shouldNotEvaluateInnerCheckForFalseWhen") { - val state1 = SemanticState.clean - val error = SemanticError("an error", DummyPosition(0)) - val func1: SemanticCheck = s => SemanticCheckResult(state1, Seq(error)) - val func2: SemanticCheck = s => fail("Second check was incorrectly run") - - val chain: SemanticCheck = func1 chain when(condition = false) { func2 } - val result = chain(SemanticState.clean) - result.state should equal(state1) - result.errors should equal(Seq(error)) - } - - test("shouldScopeState") { - val func1 = - (s:SemanticState) => { - val variable = Variable("name")(DummyPosition(0)) - s.declareVariable(variable, CTNode) - } - - val error = SemanticError("an error", DummyPosition(0)) - val func2: SemanticCheck = s => { - s.currentScope.localSymbol("name") shouldBe defined - s.currentScope.parent shouldBe defined - SemanticCheckResult.error(s, error) - } - - val chain: SemanticCheck = withScopedState { func1 chain func2 } - val state = SemanticState.clean - val result = chain(state) - result.state.currentScope.symbolNames shouldBe empty - result.errors should equal(Seq(error)) - } -} diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/SemanticStateTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/SemanticStateTest.scala deleted file mode 100644 index e037688aefa4d..0000000000000 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/SemanticStateTest.scala +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * This file is part of Neo4j. - * - * Neo4j is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.neo4j.cypher.internal.compiler.v3_5 - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticError, SemanticState} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{DummyExpression, Property, PropertyKeyName, Variable} - -class SemanticStateTest extends CypherFunSuite { - - test("should declare variable once") { - val variable1 = Variable("foo")(DummyPosition(0)) - val variable2 = Variable("foo")(DummyPosition(3)) - val state = SemanticState.clean.declareVariable(variable1, CTNode).right.get - - state.declareVariable(variable2, CTNode) match { - case Right(_) => fail("Expected an error from second declaration") - case Left(error) => - error.position should equal(variable2.position) - error.references should equal(Seq(variable1.position)) - } - } - - test("should collect all variables when implicitly declared") { - val variable1 = Variable("foo")(DummyPosition(0)) - val variable2 = Variable("foo")(DummyPosition(2)) - val variable3 = Variable("foo")(DummyPosition(3)) - - SemanticState.clean.implicitVariable(variable1, CTNode) chain - ((_: SemanticState).implicitVariable(variable2, CTNode)) chain - ((_: SemanticState).implicitVariable(variable3, CTNode)) match { - case Left(_) => fail("Expected success") - case Right(state) => - val positions = state.currentScope.localSymbol("foo").map(_.positions).get - positions should equal(Set(variable1.position, variable2.position, variable3.position)) - } - } - - test("should constrain types for consecutive implicit variable declarations") { - val variable1 = Variable("foo")(DummyPosition(0)) - val variable2 = Variable("foo")(DummyPosition(3)) - - SemanticState.clean.implicitVariable(variable1, CTNode | CTRelationship) chain - ((_: SemanticState).implicitVariable(variable2, CTNode)) match { - case Left(_) => fail("Expected success") - case Right(state) => - val types = state.symbolTypes("foo") - types should equal(CTNode: TypeSpec) - } - - SemanticState.clean.implicitVariable(variable1, CTRelationship) chain - ((_: SemanticState).implicitVariable(variable2, CTNode | CTRelationship)) match { - case Left(_) => fail("Expected success") - case Right(state) => - val types = state.symbolTypes("foo") - types should equal(CTRelationship: TypeSpec) - } - - SemanticState.clean.implicitVariable(variable1, CTNode | CTRelationship) chain - ((_: SemanticState).implicitVariable(variable2, CTAny.covariant)) match { - case Left(_) => fail("Expected success") - case Right(state) => - val types = state.symbolTypes("foo") - types should equal(CTNode | CTRelationship) - } - - SemanticState.clean.implicitVariable(variable1, CTNode) chain - ((_: SemanticState).implicitVariable(variable2, CTMap.covariant)) match { - case Left(_) => fail("Expected success") - case Right(state) => - val types = state.symbolTypes("foo") - types should equal(CTNode: TypeSpec) - } - } - - test("should fail if no possible types remain after implicit variable declaration") { - SemanticState.clean.implicitVariable(Variable("foo")(DummyPosition(0)), CTMap) chain - ((_: SemanticState).implicitVariable(Variable("foo")(DummyPosition(3)), CTNode)) match { - case Right(_) => fail("Expected an error") - case Left(error) => - error.position should equal(DummyPosition(3)) - error.references should be (Seq(DummyPosition(0))) - error.msg should equal("Type mismatch: foo already defined with conflicting type Map (expected Node)") - } - - SemanticState.clean.implicitVariable(Variable("foo")(DummyPosition(0)), CTNode | CTRelationship) chain - ((_: SemanticState).implicitVariable(Variable("foo")(DummyPosition(3)), CTNode | CTInteger)) chain - ((_: SemanticState).implicitVariable(Variable("foo")(DummyPosition(9)), CTInteger | CTRelationship)) match { - case Right(_) => fail("Expected an error") - case Left(error) => - error.position should equal(DummyPosition(9)) - error.references should equal(Seq(DummyPosition(0), DummyPosition(3))) - error.msg should equal("Type mismatch: foo already defined with conflicting type Node (expected Integer or Relationship)") - } - } - - test("should record type for expression when specifying type") { - val expression = DummyExpression(CTInteger | CTString) - val state = SemanticState.clean.specifyType(expression, expression.possibleTypes).right.get - state.expressionType(expression).specified should equal(expression.possibleTypes) - state.expressionType(expression).actual should equal(expression.possibleTypes) - } - - test("should expect type for expression") { - val expression = DummyExpression(CTInteger | CTString | CTMap) - val state = SemanticState.clean.specifyType(expression, expression.possibleTypes).right.get - - state.expectType(expression, CTNumber.covariant) match { - case (s, typ) => - typ should equal(CTInteger: TypeSpec) - s.expressionType(expression).actual should equal(typ) - } - - state.expectType(expression, CTNode.covariant | CTNumber.covariant) match { - case (s, typ) => - typ should equal(CTInteger: TypeSpec) - s.expressionType(expression).actual should equal(typ) - } - } - - test("should find symbol in parent") { - val s1 = SemanticState.clean.declareVariable(Variable("foo")(DummyPosition(0)), CTNode).right.get - val s2 = s1.newChildScope - s2.symbolTypes("foo") should equal(CTNode: TypeSpec) - } - - test("should override symbol in parent") { - val s1 = SemanticState.clean.declareVariable(Variable("foo")(DummyPosition(0)), CTNode).right.get - val s2 = s1.newChildScope.declareVariable(Variable("foo")(DummyPosition(0)), CTString).right.get - - s2.symbolTypes("foo") should equal(CTString: TypeSpec) - } - - test("should extend symbol in parent") { - val s1 = SemanticState.clean.declareVariable(Variable("foo")(DummyPosition(0)), CTNode).right.get - val s2 = s1.newChildScope.implicitVariable(Variable("foo")(DummyPosition(0)), CTAny.covariant).right.get - s2.symbolTypes("foo") should equal(CTNode: TypeSpec) - } - - test("should return types of variable") { - val variable = Variable("foo")(DummyPosition(0)) - val s1 = SemanticState.clean.declareVariable(variable, CTNode).right.get - s1.expressionType(variable).actual should equal(CTNode: TypeSpec) - } - - test("should return types of variable at later expression") { - val variable1 = Variable("foo")(DummyPosition(0)) - val variable2 = Variable("foo")(DummyPosition(3)) - val s1 = SemanticState.clean.declareVariable(variable1, CTNode).right.get - val s2 = s1.implicitVariable(variable2, CTNode).right.get - s2.expressionType(variable2).actual should equal(CTNode: TypeSpec) - } - - test("should maintain separate TypeInfo for equivalent expressions") { - val exp1 = Property(Variable("n")(DummyPosition(0)), PropertyKeyName("prop")(DummyPosition(3)))(DummyPosition(0)) - val exp2 = Property(Variable("n")(DummyPosition(6)), PropertyKeyName("prop")(DummyPosition(9)))(DummyPosition(6)) - val s1 = SemanticState.clean.specifyType(exp1, CTNode).right.get - val s2 = s1.specifyType(exp2, CTRelationship).right.get - - s2.expressionType(exp1).specified should equal(CTNode: TypeSpec) - s2.expressionType(exp2).specified should equal(CTRelationship: TypeSpec) - - val s3 = s2.expectType(exp1, CTMap)._1.expectType(exp2, CTAny)._1 - s3.expressionType(exp1).expected should equal(Some(CTMap: TypeSpec)) - s3.expressionType(exp2).expected should equal(Some(CTAny: TypeSpec)) - } - - test("should gracefully update a variable") { - val s1 = SemanticState.clean.declareVariable(Variable("foo")(DummyPosition(0)), CTNode).right.get - val s2: SemanticState = s1.newChildScope.declareVariable(Variable("foo")(DummyPosition(0)), CTRelationship).right.get - s1.symbolTypes("foo") should equal(CTNode.invariant) - s2.symbolTypes("foo") should equal(CTRelationship.invariant) - } - - test("should be able to merge scopes") { - val s1 = - SemanticState.clean - .declareVariable(Variable("foo")(DummyPosition(0)), CTNode).right.get - .declareVariable(Variable("bar")(DummyPosition(1)), CTNode).right.get - - - val s2 = - SemanticState.clean - .declareVariable(Variable("foo")(DummyPosition(1)), CTNode).right.get - .declareVariable(Variable("baz")(DummyPosition(4)), CTNode).right.get - - s2.mergeSymbolPositionsFromScope(s1.scopeTree) should equal( - SemanticState.clean - .declareVariable(Variable("foo")(DummyPosition(1)), CTNode, Set(DummyPosition(0))).right.get - .declareVariable(Variable("baz")(DummyPosition(4)), CTNode).right.get - ) - } - - test("should be able to merge scopes and honor excludes") { - val s1 = - SemanticState.clean - .declareVariable(Variable("foo")(DummyPosition(0)), CTNode).right.get - .declareVariable(Variable("bar")(DummyPosition(1)), CTNode).right.get - - val s2 = - SemanticState.clean - .declareVariable(Variable("foo")(DummyPosition(1)), CTNode).right.get - .declareVariable(Variable("baz")(DummyPosition(4)), CTNode).right.get - - s2.mergeSymbolPositionsFromScope(s1.scopeTree, Set("foo")) should equal(s2) - } - - test("should be able to import scopes") { - val s1 = - SemanticState.clean - .declareVariable(Variable("foo")(DummyPosition(0)), CTNode).right.get - .declareVariable(Variable("bar")(DummyPosition(1)), CTNode).right.get - - - val s2 = - SemanticState.clean - .declareVariable(Variable("foo")(DummyPosition(1)), CTNode).right.get - .declareVariable(Variable("baz")(DummyPosition(4)), CTNode).right.get - - val actual = s1.importValuesFromScope(s2.scopeTree) - val expected = - SemanticState.clean - .declareVariable(Variable("foo")(DummyPosition(1)), CTNode).right.get - .declareVariable(Variable("bar")(DummyPosition(1)), CTNode).right.get - .declareVariable(Variable("baz")(DummyPosition(4)), CTNode).right.get - - - actual.scopeTree should equal(expected.scopeTree) - } - - test("should be able to import scopes and honor excludes") { - val s1 = - SemanticState.clean - .declareVariable(Variable("foo")(DummyPosition(0)), CTNode).right.get - .declareVariable(Variable("bar")(DummyPosition(1)), CTNode).right.get - - - val s2 = - SemanticState.clean - .declareVariable(Variable("foo")(DummyPosition(1)), CTNode).right.get - .declareVariable(Variable("baz")(DummyPosition(4)), CTNode).right.get - .declareVariable(Variable("frob")(DummyPosition(5)), CTNode).right.get - - val actual = s1.importValuesFromScope(s2.scopeTree, Set("foo", "frob")) - val expected = - SemanticState.clean - .declareVariable(Variable("foo")(DummyPosition(0)), CTNode).right.get - .declareVariable(Variable("bar")(DummyPosition(1)), CTNode).right.get - .declareVariable(Variable("baz")(DummyPosition(4)), CTNode).right.get - - - actual.scopeTree should equal(expected.scopeTree) - } - - implicit class ChainableSemanticStateEither(either: Either[SemanticError, SemanticState]) { - def chain(next: SemanticState => Either[SemanticError, SemanticState]): Either[SemanticError, SemanticState] = { - either match { - case Left(_) => either - case Right(state) => next(state) - } - } - } -} diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/CallClauseTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/CallClauseTest.scala index 7344aa88c7016..45a17251805cb 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/CallClauseTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/CallClauseTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticCheckResult, SemanticState} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.ast.semantics.{SemanticCheckResult, SemanticState} +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans._ class CallClauseTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/QueryTaggerTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/QueryTaggerTest.scala index 1b5a884771ddb..9a5c0674a714e 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/QueryTaggerTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/QueryTaggerTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class QueryTaggerTest extends CypherFunSuite { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/QueryTagsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/QueryTagsTest.scala index 3025a3b0a2223..278d4c5bab8c9 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/QueryTagsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/QueryTagsTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class QueryTagsTest extends CypherFunSuite { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/AggregationsAreIsolatedTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/AggregationsAreIsolatedTest.scala index d9cc75b8124c7..ef27384f7a491 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/AggregationsAreIsolatedTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/AggregationsAreIsolatedTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.conditions -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ast.AstConstructionTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.ast.conditions.aggregationsAreIsolated -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.AstConstructionTestSupport +import org.opencypher.v9_0.ast.conditions.aggregationsAreIsolated +import org.opencypher.v9_0.expressions._ class AggregationsAreIsolatedTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/CollectNodesOfTypeTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/CollectNodesOfTypeTest.scala index 3cd33b34de49b..7fd2c23362351 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/CollectNodesOfTypeTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/CollectNodesOfTypeTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.conditions -import org.neo4j.cypher.internal.util.v3_5.ASTNode -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ast.{AstConstructionTestSupport, Match} -import org.neo4j.cypher.internal.frontend.v3_5.ast.conditions.collectNodesOfType -import org.neo4j.cypher.internal.v3_5.expressions.{EveryPath, NodePattern, Pattern, Variable} +import org.opencypher.v9_0.util.ASTNode +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.{AstConstructionTestSupport, Match} +import org.opencypher.v9_0.ast.conditions.collectNodesOfType +import org.opencypher.v9_0.expressions.{EveryPath, NodePattern, Pattern, Variable} class CollectNodesOfTypeTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/ContainsNamedPathOnlyForShortestPathTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/ContainsNamedPathOnlyForShortestPathTest.scala index 911dfa23500f5..2120bc9ef7d55 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/ContainsNamedPathOnlyForShortestPathTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/ContainsNamedPathOnlyForShortestPathTest.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.conditions -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ class ContainsNamedPathOnlyForShortestPathTest extends CypherFunSuite with AstConstructionTestSupport { private val condition: (Any => Seq[String]) = containsNamedPathOnlyForShortestPath diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/ContainsNoMatchingNodesTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/ContainsNoMatchingNodesTest.scala index 966c4a371d82f..240fe2a7b8a79 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/ContainsNoMatchingNodesTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/ContainsNoMatchingNodesTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.conditions -import org.neo4j.cypher.internal.util.v3_5.ASTNode -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.conditions.containsNoMatchingNodes -import org.neo4j.cypher.internal.v3_5.expressions.Variable +import org.opencypher.v9_0.util.ASTNode +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.ast.conditions.containsNoMatchingNodes +import org.opencypher.v9_0.expressions.Variable class ContainsNoMatchingNodesTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/ContainsNoNodesOfTypeTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/ContainsNoNodesOfTypeTest.scala index 6f633e4dd2a99..8488f1c38c8ac 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/ContainsNoNodesOfTypeTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/ContainsNoNodesOfTypeTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.conditions -import org.neo4j.cypher.internal.util.v3_5.ASTNode -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.conditions.containsNoNodesOfType -import org.neo4j.cypher.internal.v3_5.expressions.{EveryPath, NodePattern, Pattern, Variable} +import org.opencypher.v9_0.util.ASTNode +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.ast.conditions.containsNoNodesOfType +import org.opencypher.v9_0.expressions.{EveryPath, NodePattern, Pattern, Variable} class ContainsNoNodesOfTypeTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/NoDuplicatesInReturnItemsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/NoDuplicatesInReturnItemsTest.scala index 09c0b76ed9258..42235c17975fb 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/NoDuplicatesInReturnItemsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/NoDuplicatesInReturnItemsTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.conditions -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.conditions.noDuplicatesInReturnItems -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.UnsignedDecimalIntegerLiteral +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.ast.conditions.noDuplicatesInReturnItems +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.UnsignedDecimalIntegerLiteral class NoDuplicatesInReturnItemsTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/NoReferenceEqualityAmongVariablesTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/NoReferenceEqualityAmongVariablesTest.scala index 1adb0fa79172b..818c65dac2f21 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/NoReferenceEqualityAmongVariablesTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/NoReferenceEqualityAmongVariablesTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.conditions -import org.neo4j.cypher.internal.util.v3_5.ASTNode -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.conditions.noReferenceEqualityAmongVariables -import org.neo4j.cypher.internal.v3_5.expressions.{EveryPath, NodePattern, Pattern} +import org.opencypher.v9_0.util.ASTNode +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.ast.conditions.noReferenceEqualityAmongVariables +import org.opencypher.v9_0.expressions.{EveryPath, NodePattern, Pattern} class NoReferenceEqualityAmongVariablesTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/NoUnnamedPatternElementsInMatchTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/NoUnnamedPatternElementsInMatchTest.scala index f5d4efebfd3f9..6240fac5e8ee6 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/NoUnnamedPatternElementsInMatchTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/NoUnnamedPatternElementsInMatchTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.conditions -import org.neo4j.cypher.internal.util.v3_5.ASTNode -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.conditions.noUnnamedPatternElementsInMatch -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.ASTNode +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.ast.conditions.noUnnamedPatternElementsInMatch +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ class NoUnnamedPatternElementsInMatchTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/NormalizedEqualsArgumentsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/NormalizedEqualsArgumentsTest.scala index a0c22a700868c..a56d394ab39e2 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/NormalizedEqualsArgumentsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/NormalizedEqualsArgumentsTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.conditions -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.conditions.normalizedEqualsArguments -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.ast.conditions.normalizedEqualsArguments +import org.opencypher.v9_0.expressions._ class NormalizedEqualsArgumentsTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/OrderByOnlyOnVariablesTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/OrderByOnlyOnVariablesTest.scala index 90ef75b9eb0bc..be8315f44b890 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/OrderByOnlyOnVariablesTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/OrderByOnlyOnVariablesTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.conditions -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, DummyPosition} -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.conditions.orderByOnlyOnVariables -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, UnsignedDecimalIntegerLiteral} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.{ASTNode, DummyPosition} +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.ast.conditions.orderByOnlyOnVariables +import org.opencypher.v9_0.expressions.{Expression, UnsignedDecimalIntegerLiteral} class OrderByOnlyOnVariablesTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/noUnnamedPatternElementsInPatternComprehensionTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/noUnnamedPatternElementsInPatternComprehensionTest.scala index 1afc6e80757ea..3d733a35e1939 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/noUnnamedPatternElementsInPatternComprehensionTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/conditions/noUnnamedPatternElementsInPatternComprehensionTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.conditions -import org.neo4j.cypher.internal.util.v3_5.ASTNode -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.conditions.noUnnamedPatternElementsInPatternComprehension -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.ASTNode +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.ast.conditions.noUnnamedPatternElementsInPatternComprehension +import org.opencypher.v9_0.expressions._ class noUnnamedPatternElementsInPatternComprehensionTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/GroupInequalityPredicatesTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/GroupInequalityPredicatesTest.scala index 79a2125845d79..fab4101527318 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/GroupInequalityPredicatesTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/GroupInequalityPredicatesTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.convert.plannerQuery -import org.neo4j.cypher.internal.util.v3_5.NonEmptyList -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ast._ +import org.opencypher.v9_0.util.NonEmptyList +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast._ import org.neo4j.cypher.internal.ir.v3_5.Predicate -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ class GroupInequalityPredicatesTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/MutatingStatementConvertersTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/MutatingStatementConvertersTest.scala index 917a6dfa54f3c..30b76485a5f35 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/MutatingStatementConvertersTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/MutatingStatementConvertersTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.convert.plannerQuery -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.ir.v3_5._ -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection.OUTGOING -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions.SemanticDirection.OUTGOING +import org.opencypher.v9_0.expressions._ class MutatingStatementConvertersTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/PatternExpressionConverterTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/PatternExpressionConverterTest.scala index 4f29933301977..bf21a83fa7013 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/PatternExpressionConverterTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/PatternExpressionConverterTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.convert.plannerQuery -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport import org.neo4j.cypher.internal.ir.v3_5._ -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.ir.v3_5.helpers.ExpressionConverters._ class PatternExpressionConverterTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/StatementConvertersTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/StatementConvertersTest.scala index c629374c73787..0923d4bf3abd1 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/StatementConvertersTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/StatementConvertersTest.scala @@ -20,13 +20,13 @@ package org.neo4j.cypher.internal.compiler.v3_5.ast.convert.plannerQuery import org.neo4j.cypher.internal.compiler.v3_5.planner.{LogicalPlanningTestSupport, _} -import org.neo4j.cypher.internal.frontend.v3_5.ast.{Hint, UsingIndexHint} -import org.neo4j.cypher.internal.frontend.v3_5.helpers.StringHelper._ +import org.opencypher.v9_0.ast.{Hint, UsingIndexHint} +import org.opencypher.v9_0.util.helpers.StringHelper._ import org.neo4j.cypher.internal.ir.v3_5._ -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection.{BOTH, INCOMING, OUTGOING} -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection.{BOTH, INCOMING, OUTGOING} +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans.{FieldSignature, ProcedureReadOnlyAccess, ProcedureSignature, QualifiedName} class StatementConvertersTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/UnionStatementConvertersTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/UnionStatementConvertersTest.scala index 4031e8942b68d..8ad94b0d1e121 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/UnionStatementConvertersTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/convert/plannerQuery/UnionStatementConvertersTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.convert.plannerQuery -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport import org.neo4j.cypher.internal.ir.v3_5.RegularQueryProjection -import org.neo4j.cypher.internal.v3_5.expressions.SignedDecimalIntegerLiteral +import org.opencypher.v9_0.expressions.SignedDecimalIntegerLiteral class UnionStatementConvertersTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/AddUniquenessPredicatesTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/AddUniquenessPredicatesTest.scala index 8a089ab45bc3f..bf6303f99af71 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/AddUniquenessPredicatesTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/AddUniquenessPredicatesTest.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.Rewriter -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.addUniquenessPredicates -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.Rewriter +import org.opencypher.v9_0.rewriting.rewriters.addUniquenessPredicates +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class AddUniquenessPredicatesTest extends CypherFunSuite with RewriteTest { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/CNFNormalizerTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/CNFNormalizerTest.scala index 5969a46475666..a75c333baa551 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/CNFNormalizerTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/CNFNormalizerTest.scala @@ -21,12 +21,11 @@ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters import org.mockito.ArgumentMatchers._ import org.mockito.Mockito._ -import org.neo4j.cypher.internal.util.v3_5.Rewriter +import org.opencypher.v9_0.util.Rewriter import org.neo4j.cypher.internal.compiler.v3_5.test_helpers.ContextHelper -import org.neo4j.cypher.internal.frontend.v3_5.AstRewritingMonitor -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.CNFNormalizer -import org.neo4j.cypher.internal.frontend.v3_5.phases.Monitors -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.frontend.phases.{CNFNormalizer, Monitors} +import org.opencypher.v9_0.rewriting.AstRewritingMonitor +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class CNFNormalizerTest extends CypherFunSuite with PredicateTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/CollapseInCollectionsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/CollapseInCollectionsTest.scala index f97dd2224d5a5..f3460cbe2e893 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/CollapseInCollectionsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/CollapseInCollectionsTest.scala @@ -21,8 +21,9 @@ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters import org.neo4j.cypher.internal.compiler.v3_5.planner.AstRewritingTestSupport import org.neo4j.cypher.internal.compiler.v3_5.test_helpers.ContextHelper -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.{CNFNormalizer, collapseMultipleInPredicates} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.frontend.phases.CNFNormalizer +import org.opencypher.v9_0.rewriting.rewriters.collapseMultipleInPredicates +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class CollapseInCollectionsTest extends CypherFunSuite with AstRewritingTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/DeMorganRewriterTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/DeMorganRewriterTest.scala index cb84075bcf2ef..7f846cee3621b 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/DeMorganRewriterTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/DeMorganRewriterTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.Rewriter -import org.neo4j.cypher.internal.frontend.v3_5.AstRewritingMonitor -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.deMorganRewriter -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.Rewriter +import org.opencypher.v9_0.rewriting.AstRewritingMonitor +import org.opencypher.v9_0.rewriting.rewriters.deMorganRewriter +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class DeMorganRewriterTest extends CypherFunSuite with PredicateTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/DesugarDesugaredMapProjectionTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/DesugarDesugaredMapProjectionTest.scala index 5a30a3946af50..a2eefc1507509 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/DesugarDesugaredMapProjectionTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/DesugarDesugaredMapProjectionTest.scala @@ -19,13 +19,13 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, inSequence} +import org.opencypher.v9_0.util.{Rewriter, inSequence} import org.neo4j.cypher.internal.compiler.v3_5.SyntaxExceptionCreator -import org.neo4j.cypher.internal.compiler.v3_5.parser.ParserFixture.parser -import org.neo4j.cypher.internal.frontend.v3_5.ast.Statement -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.{desugarMapProjection, normalizeReturnClauses, normalizeWithClauses, recordScopes} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticState +import org.opencypher.v9_0.parser.ParserFixture.parser +import org.opencypher.v9_0.ast.Statement +import org.opencypher.v9_0.rewriting.rewriters.{desugarMapProjection, normalizeReturnClauses, normalizeWithClauses, recordScopes} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.semantics.SemanticState class DesugarDesugaredMapProjectionTest extends CypherFunSuite { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/DistributeLawRewriterTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/DistributeLawRewriterTest.scala index 3ec71a46f2f79..c6283b3b64cbb 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/DistributeLawRewriterTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/DistributeLawRewriterTest.scala @@ -20,11 +20,11 @@ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters import org.mockito.Mockito._ -import org.neo4j.cypher.internal.util.v3_5.Rewriter -import org.neo4j.cypher.internal.frontend.v3_5.AstRewritingMonitor -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.distributeLawsRewriter -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.Or +import org.opencypher.v9_0.util.Rewriter +import org.opencypher.v9_0.rewriting.AstRewritingMonitor +import org.opencypher.v9_0.rewriting.rewriters.distributeLawsRewriter +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.Or class DistributeLawRewriterTest extends CypherFunSuite with PredicateTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ExpandCallWhereTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ExpandCallWhereTest.scala index 0f3a3a36f4827..8a2db3273b6b7 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ExpandCallWhereTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ExpandCallWhereTest.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.frontend.v3_5.ast.AstConstructionTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.expandCallWhere -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.AstConstructionTestSupport +import org.opencypher.v9_0.rewriting.rewriters.expandCallWhere +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class ExpandCallWhereTest extends CypherFunSuite with RewriteTest with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ExpandStarTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ExpandStarTest.scala index a2f404f3b3ddc..6d06612e74404 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ExpandStarTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ExpandStarTest.scala @@ -19,16 +19,16 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.inSequence -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.inSequence +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.{expandStar, normalizeGraphReturnItems, normalizeReturnClauses, normalizeWithClauses} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticFeature, SemanticState} +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.rewriting.rewriters.{expandStar, normalizeGraphReturnItems, normalizeReturnClauses, normalizeWithClauses} +import org.opencypher.v9_0.ast.semantics.{SemanticFeature, SemanticState} class ExpandStarTest extends CypherFunSuite with AstConstructionTestSupport { - import parser.ParserFixture.parser + import org.opencypher.v9_0.parser.ParserFixture.parser test("rewrites * in return") { assertRewrite( diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/FlattenBooleanOperatorsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/FlattenBooleanOperatorsTest.scala index b4dbb410cace7..11d83b24d0eb9 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/FlattenBooleanOperatorsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/FlattenBooleanOperatorsTest.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.flattenBooleanOperators -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.rewriting.rewriters.flattenBooleanOperators +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class FlattenBooleanOperatorsTest extends CypherFunSuite with PredicateTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/FoldConstantsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/FoldConstantsTest.scala index 7a0eafee6e026..f98712bd25d55 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/FoldConstantsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/FoldConstantsTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.Rewriter -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.foldConstants -import org.neo4j.cypher.internal.frontend.v3_5.helpers.fixedPoint -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.rewriting.rewriters.foldConstants +import org.opencypher.v9_0.util.Rewriter +import org.opencypher.v9_0.util.helpers.fixedPoint +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class FoldConstantsTest extends CypherFunSuite with RewriteTest { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/InlineProjectionsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/InlineProjectionsTest.scala index 753f57647615b..a95cde3fbe98e 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/InlineProjectionsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/InlineProjectionsTest.scala @@ -19,13 +19,13 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.{InternalException, inSequence} +import org.opencypher.v9_0.util.{InternalException, inSequence} import org.neo4j.cypher.internal.compiler.v3_5.SyntaxExceptionCreator import org.neo4j.cypher.internal.compiler.v3_5.planner.AstRewritingTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.{expandStar, normalizeReturnClauses, normalizeWithClauses} -import org.neo4j.cypher.internal.frontend.v3_5.helpers.StringHelper._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticState +import org.opencypher.v9_0.rewriting.rewriters.{expandStar, normalizeReturnClauses, normalizeWithClauses} +import org.opencypher.v9_0.util.helpers.StringHelper._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.semantics.SemanticState class InlineProjectionsTest extends CypherFunSuite with AstRewritingTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/InliningContextCreatorTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/InliningContextCreatorTest.scala index 83850b6004f89..774d018c1d29f 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/InliningContextCreatorTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/InliningContextCreatorTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters import org.neo4j.cypher.internal.compiler.v3_5.planner.AstRewritingTestSupport -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class InliningContextCreatorTest extends CypherFunSuite with AstRewritingTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/InliningContextTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/InliningContextTest.scala index b8fca7807fa00..3d91326f04ba8 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/InliningContextTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/InliningContextTest.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ class InliningContextTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/IsolateAggregationTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/IsolateAggregationTest.scala index b084d92d85341..33acc8912a890 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/IsolateAggregationTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/IsolateAggregationTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.inSequence +import org.opencypher.v9_0.util.inSequence import org.neo4j.cypher.internal.compiler.v3_5.SyntaxExceptionCreator -import org.neo4j.cypher.internal.frontend.v3_5.ast.AstConstructionTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.{isolateAggregation, normalizeReturnClauses, normalizeWithClauses} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.AstConstructionTestSupport +import org.opencypher.v9_0.rewriting.rewriters.{isolateAggregation, normalizeReturnClauses, normalizeWithClauses} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class IsolateAggregationTest extends CypherFunSuite with RewriteTest with AstConstructionTestSupport { val rewriterUnderTest = isolateAggregation diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/LiteralReplacementTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/LiteralReplacementTest.scala index 2d5cb37e9797b..ba6658f97e636 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/LiteralReplacementTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/LiteralReplacementTest.scala @@ -20,15 +20,15 @@ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.{Forced, IfNoParameter, LiteralExtraction, literalReplacement} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.v3_5.expressions.Parameter +import org.opencypher.v9_0.rewriting.rewriters.{Forced, IfNoParameter, LiteralExtraction, literalReplacement} +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.{Rewriter, bottomUp} +import org.opencypher.v9_0.expressions.Parameter class LiteralReplacementTest extends CypherFunSuite { - import org.neo4j.cypher.internal.compiler.v3_5.parser.ParserFixture.parser + import org.opencypher.v9_0.parser.ParserFixture.parser test("should extract starts with patterns") { assertRewrite("RETURN x STARTS WITH 'Pattern' as X", "RETURN x STARTS WITH {` AUTOSTRING0`} as X", Map(" AUTOSTRING0" -> "Pattern")) diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/MatchPredicateNormalizerTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/MatchPredicateNormalizerTest.scala index 2700a31d12bf4..f835a61cd9b39 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/MatchPredicateNormalizerTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/MatchPredicateNormalizerTest.scala @@ -19,12 +19,12 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, inSequence} -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.{LabelPredicateNormalizer, MatchPredicateNormalization, PropertyPredicateNormalizer} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.{GetDegree, GreaterThan} -import org.neo4j.cypher.internal.compiler.v3_5.parser.ParserFixture.parser +import org.opencypher.v9_0.util.{Rewriter, inSequence} +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.rewriting.rewriters.{LabelPredicateNormalizer, MatchPredicateNormalization, PropertyPredicateNormalizer} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.{GetDegree, GreaterThan} +import org.opencypher.v9_0.parser.ParserFixture.parser class MatchPredicateNormalizerTest extends CypherFunSuite with RewriteTest { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NameGraphOfPatternElementTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NameGraphOfPatternElementTest.scala index 72cd5ba49c96e..ad4d226d94941 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NameGraphOfPatternElementTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NameGraphOfPatternElementTest.scala @@ -19,13 +19,12 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.compiler.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.nameGraphOfPatternElements -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.rewriting.rewriters.nameGraphOfPatternElements +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class NameGraphOfPatternElementTest extends CypherFunSuite { - import parser.ParserFixture._ + import org.opencypher.v9_0.parser.ParserFixture._ test("name all node patterns in GRAPH OF") { val original = parser.parse("RETURN GRAPH OF (n)-[r:Foo]->() RETURN n") diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NameMatchPatternElementTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NameMatchPatternElementTest.scala index 5478643378581..69c708fd9661c 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NameMatchPatternElementTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NameMatchPatternElementTest.scala @@ -20,12 +20,12 @@ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters import org.neo4j.cypher.internal.compiler.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.{nameMatchPatternElements, nameUpdatingClauses} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.rewriting.rewriters.{nameMatchPatternElements, nameUpdatingClauses} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class NameMatchPatternElementTest extends CypherFunSuite { - import parser.ParserFixture._ + import org.opencypher.v9_0.parser.ParserFixture._ test("name all NodePatterns in Query") { val original = parser.parse("MATCH (n)-[r:Foo]->() RETURN n") diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NamespacerTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NamespacerTest.scala index 483071d411e50..cca17db42acce 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NamespacerTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NamespacerTest.scala @@ -20,19 +20,20 @@ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters import org.neo4j.cypher.internal.compiler.v3_5._ -import org.neo4j.cypher.internal.compiler.v3_5.parser.ParserFixture.parser +import org.opencypher.v9_0.parser.ParserFixture.parser import org.neo4j.cypher.internal.compiler.v3_5.phases.LogicalPlanState import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanConstructionTestSupport import org.neo4j.cypher.internal.compiler.v3_5.test_helpers.ContextHelper -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.{AstConstructionTestSupport, Statement} -import org.neo4j.cypher.internal.frontend.v3_5.helpers.StatementHelper._ -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.RewriterStepSequencer -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticFeature +import org.opencypher.v9_0.rewriting.rewriters._ +import org.opencypher.v9_0.ast.{AstConstructionTestSupport, Statement} +import org.opencypher.v9_0.ast.semantics.SemanticFeature import org.neo4j.cypher.internal.planner.v3_5.spi.IDPPlannerName -import org.neo4j.cypher.internal.util.v3_5.inSequence -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.inSequence +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.frontend.phases.{ASTRewriter, Namespacer} +import org.opencypher.v9_0.rewriting.RewriterStepSequencer +import org.opencypher.v9_0.ast.StatementHelper._ class NamespacerTest extends CypherFunSuite with AstConstructionTestSupport with LogicalPlanConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeArgumentOrderTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeArgumentOrderTest.scala index 6e4b347efac3e..4e137ef52213e 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeArgumentOrderTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeArgumentOrderTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.normalizeArgumentOrder -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ast.AstConstructionTestSupport -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.rewriting.rewriters.normalizeArgumentOrder +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.AstConstructionTestSupport +import org.opencypher.v9_0.expressions._ class NormalizeArgumentOrderTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeComparisonsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeComparisonsTest.scala index 16106765f3f5e..fce92b49623b0 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeComparisonsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeComparisonsTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.frontend.v3_5.ast.AstConstructionTestSupport -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.normalizeComparisons -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.ast.AstConstructionTestSupport +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.rewriting.rewriters.normalizeComparisons +import org.opencypher.v9_0.expressions._ class NormalizeComparisonsTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeNotEqualsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeNotEqualsTest.scala index db65fe9b5b25f..b1ef9d73ffdce 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeNotEqualsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeNotEqualsTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.normalizeNotEquals -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.DummyPosition +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.rewriting.rewriters.normalizeNotEquals +import org.opencypher.v9_0.expressions._ class NormalizeNotEqualsTest extends CypherFunSuite { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeReturnClausesTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeReturnClausesTest.scala index f5389c3950dbd..7d19f865b3282 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeReturnClausesTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeReturnClausesTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, SyntaxException} +import org.opencypher.v9_0.util.{Rewriter, SyntaxException} import org.neo4j.cypher.internal.compiler.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.AstConstructionTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.normalizeReturnClauses -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.AstConstructionTestSupport +import org.opencypher.v9_0.rewriting.rewriters.normalizeReturnClauses +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class NormalizeReturnClausesTest extends CypherFunSuite with RewriteTest with AstConstructionTestSupport { val mkException = new SyntaxExceptionCreator("", Some(pos)) diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeSargablePredicatesTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeSargablePredicatesTest.scala index 9dbf262a3926a..836d13b610936 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeSargablePredicatesTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeSargablePredicatesTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.normalizeSargablePredicates -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ -import org.neo4j.cypher.internal.v3_5.functions.Exists +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.rewriting.rewriters.normalizeSargablePredicates +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.expressions.functions.Exists class NormalizeSargablePredicatesTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeWithClausesTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeWithClausesTest.scala index 1935ad59267ec..73893d17b53da 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeWithClausesTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/NormalizeWithClausesTest.scala @@ -19,12 +19,12 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, SyntaxException} +import org.opencypher.v9_0.util.{Rewriter, SyntaxException} import org.neo4j.cypher.internal.compiler.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.AstConstructionTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.normalizeWithClauses -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticState +import org.opencypher.v9_0.ast.AstConstructionTestSupport +import org.opencypher.v9_0.rewriting.rewriters.normalizeWithClauses +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.semantics.SemanticState class NormalizeWithClausesTest extends CypherFunSuite with RewriteTest with AstConstructionTestSupport { val mkException = new SyntaxExceptionCreator("", Some(pos)) diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/PredicateTestSupport.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/PredicateTestSupport.scala index 6cc60635b77e7..1727dbe1c3422 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/PredicateTestSupport.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/PredicateTestSupport.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.{DummyPosition, Rewriter} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.{CypherFunSuite, CypherTestSupport} -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.{DummyPosition, Rewriter} +import org.opencypher.v9_0.util.test_helpers.{CypherFunSuite, CypherTestSupport} +import org.opencypher.v9_0.expressions._ trait PredicateTestSupport extends CypherTestSupport { self: CypherFunSuite => diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ProjectFreshSortExpressionsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ProjectFreshSortExpressionsTest.scala index 460f21ca5bcef..5055e3b2f5f58 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ProjectFreshSortExpressionsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ProjectFreshSortExpressionsTest.scala @@ -19,12 +19,12 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, inSequence} +import org.opencypher.v9_0.util.{Rewriter, inSequence} import org.neo4j.cypher.internal.compiler.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.AstConstructionTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.{expandStar, normalizeReturnClauses, normalizeWithClauses, projectFreshSortExpressions} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticState +import org.opencypher.v9_0.ast.AstConstructionTestSupport +import org.opencypher.v9_0.rewriting.rewriters.{expandStar, normalizeReturnClauses, normalizeWithClauses, projectFreshSortExpressions} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.semantics.SemanticState class ProjectFreshSortExpressionsTest extends CypherFunSuite with RewriteTest with AstConstructionTestSupport { val rewriterUnderTest: Rewriter = projectFreshSortExpressions diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ProjectNamedPathsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ProjectNamedPathsTest.scala index c4b6217bb68a4..404caad568b14 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ProjectNamedPathsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ProjectNamedPathsTest.scala @@ -19,14 +19,14 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.inSequence -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.inSequence +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.SyntaxExceptionCreator import org.neo4j.cypher.internal.compiler.v3_5.planner.AstRewritingTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.{expandStar, normalizeReturnClauses, normalizeWithClauses, projectNamedPaths} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticState -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.rewriting.rewriters.{expandStar, normalizeReturnClauses, normalizeWithClauses, projectNamedPaths} +import org.opencypher.v9_0.ast.semantics.SemanticState +import org.opencypher.v9_0.expressions._ class ProjectNamedPathsTest extends CypherFunSuite with AstRewritingTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ReattachAliasedExpressionsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ReattachAliasedExpressionsTest.scala index ea6ad057e64cc..8941cda646d2a 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ReattachAliasedExpressionsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ReattachAliasedExpressionsTest.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.Rewriter -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.Rewriter +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class ReattachAliasedExpressionsTest extends CypherFunSuite with RewriteTest { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ReplaceAliasedFunctionInvocationsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ReplaceAliasedFunctionInvocationsTest.scala index 9cc5b22562551..105fe53393509 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ReplaceAliasedFunctionInvocationsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ReplaceAliasedFunctionInvocationsTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ast.AstConstructionTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.replaceAliasedFunctionInvocations -import org.neo4j.cypher.internal.v3_5.expressions.{FunctionInvocation, FunctionName} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.AstConstructionTestSupport +import org.opencypher.v9_0.rewriting.rewriters.replaceAliasedFunctionInvocations +import org.opencypher.v9_0.expressions.{FunctionInvocation, FunctionName} class ReplaceAliasedFunctionInvocationsTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ReplaceLiteralDynamicPropertyLookupsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ReplaceLiteralDynamicPropertyLookupsTest.scala index ae13eaa88e6e7..30d8e8119437c 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ReplaceLiteralDynamicPropertyLookupsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ReplaceLiteralDynamicPropertyLookupsTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.ASTNode -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.replaceLiteralDynamicPropertyLookups -import org.neo4j.cypher.internal.v3_5.expressions.{ContainerIndex, Property, PropertyKeyName, StringLiteral} +import org.opencypher.v9_0.util.ASTNode +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.rewriting.rewriters.replaceLiteralDynamicPropertyLookups +import org.opencypher.v9_0.expressions.{ContainerIndex, Property, PropertyKeyName, StringLiteral} class ReplaceLiteralDynamicPropertyLookupsTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ReturnItemSafeTopDownRewriterTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ReturnItemSafeTopDownRewriterTest.scala index dc3534208b1eb..19bc1664aba9b 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ReturnItemSafeTopDownRewriterTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/ReturnItemSafeTopDownRewriterTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.Rewriter -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.ReturnItemSafeTopDownRewriter -import org.neo4j.cypher.internal.v3_5.expressions.{Equals, Variable} +import org.opencypher.v9_0.util.Rewriter +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.rewriting.rewriters.ReturnItemSafeTopDownRewriter +import org.opencypher.v9_0.expressions.{Equals, Variable} class ReturnItemSafeTopDownRewriterTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/RewriteEqualityToInPredicateTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/RewriteEqualityToInPredicateTest.scala index 25576e5e8ca11..d43eef17dd781 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/RewriteEqualityToInPredicateTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/RewriteEqualityToInPredicateTest.scala @@ -22,9 +22,9 @@ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters import org.neo4j.cypher.internal.compiler.v3_5.phases.LogicalPlanState import org.neo4j.cypher.internal.compiler.v3_5.planner.{AstRewritingTestSupport, LogicalPlanConstructionTestSupport} import org.neo4j.cypher.internal.compiler.v3_5.test_helpers.ContextHelper -import org.neo4j.cypher.internal.frontend.v3_5.ast.Query -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.rewriteEqualityToInPredicate -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.Query +import org.opencypher.v9_0.frontend.phases.rewriteEqualityToInPredicate +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class RewriteEqualityToInPredicateTest extends CypherFunSuite with AstRewritingTestSupport with LogicalPlanConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/RewriteTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/RewriteTest.scala index 3fec87b191155..66e1a516fa5fa 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/RewriteTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/RewriteTest.scala @@ -19,16 +19,15 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.Rewriter -import org.neo4j.cypher.internal.compiler.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.Statement -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticChecker +import org.opencypher.v9_0.ast.Statement +import org.opencypher.v9_0.ast.semantics.SemanticChecker +import org.opencypher.v9_0.util.Rewriter +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite trait RewriteTest { self: CypherFunSuite => - import parser.ParserFixture._ + import org.opencypher.v9_0.parser.ParserFixture._ def rewriterUnderTest: Rewriter diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/SimplifyPredicatesTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/SimplifyPredicatesTest.scala index b37fc52a11e13..d4815fa321944 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/SimplifyPredicatesTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/SimplifyPredicatesTest.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.simplifyPredicates -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.rewriting.rewriters.simplifyPredicates +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class SimplifyPredicatesTest extends CypherFunSuite with PredicateTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/TransitiveClosureTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/TransitiveClosureTest.scala index c657f96f6fa37..ff3ae59a5b71b 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/TransitiveClosureTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/TransitiveClosureTest.scala @@ -22,9 +22,9 @@ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters import org.neo4j.cypher.internal.compiler.v3_5.phases.LogicalPlanState import org.neo4j.cypher.internal.compiler.v3_5.planner.{AstRewritingTestSupport, LogicalPlanConstructionTestSupport} import org.neo4j.cypher.internal.compiler.v3_5.test_helpers.ContextHelper -import org.neo4j.cypher.internal.frontend.v3_5.ast.Query -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.{CNFNormalizer, transitiveClosure} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.Query +import org.opencypher.v9_0.frontend.phases.{CNFNormalizer, transitiveClosure} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class TransitiveClosureTest extends CypherFunSuite with AstRewritingTestSupport with LogicalPlanConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/createGraphIntroducesHorizonTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/createGraphIntroducesHorizonTest.scala index 75fab789143bd..6031731f5cd45 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/createGraphIntroducesHorizonTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/createGraphIntroducesHorizonTest.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.frontend.v3_5.ast.AstConstructionTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.createGraphIntroducesHorizon -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.AstConstructionTestSupport +import org.opencypher.v9_0.rewriting.rewriters.createGraphIntroducesHorizon +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class createGraphIntroducesHorizonTest extends CypherFunSuite with RewriteTest with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/inlineNamedPathsInPatternComprehensionsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/inlineNamedPathsInPatternComprehensionsTest.scala index 88ed0857d03d5..ebf6347727ec4 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/inlineNamedPathsInPatternComprehensionsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/inlineNamedPathsInPatternComprehensionsTest.scala @@ -19,12 +19,12 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.ASTNode +import org.opencypher.v9_0.util.ASTNode import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.projection -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.{inlineNamedPathsInPatternComprehensions, projectNamedPaths} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.rewriting.rewriters.{inlineNamedPathsInPatternComprehensions, projectNamedPaths} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ class inlineNamedPathsInPatternComprehensionsTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/mergeInPredicatesTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/mergeInPredicatesTest.scala index 5bd9f82b05b8d..614395a967e7e 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/mergeInPredicatesTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/mergeInPredicatesTest.scala @@ -21,9 +21,10 @@ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters import org.neo4j.cypher.internal.compiler.v3_5.planner.AstRewritingTestSupport import org.neo4j.cypher.internal.compiler.v3_5.test_helpers.ContextHelper -import org.neo4j.cypher.internal.frontend.v3_5.ast.Query -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.{CNFNormalizer, mergeInPredicates} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.Query +import org.opencypher.v9_0.frontend.phases.CNFNormalizer +import org.opencypher.v9_0.rewriting.rewriters.mergeInPredicates +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class mergeInPredicatesTest extends CypherFunSuite with AstRewritingTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/namePatternComprehensionPatternElementsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/namePatternComprehensionPatternElementsTest.scala index a3f0d073501d9..077f2f9235590 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/namePatternComprehensionPatternElementsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/namePatternComprehensionPatternElementsTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters -import org.neo4j.cypher.internal.util.v3_5.ASTNode -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.namePatternComprehensionPatternElements -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.ASTNode +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.rewriting.rewriters.namePatternComprehensionPatternElements +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ class namePatternComprehensionPatternElementsTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/normalizeGraphReturnItemsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/normalizeGraphReturnItemsTest.scala index 4c5d8fd41811f..f5ea4c723ad0e 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/normalizeGraphReturnItemsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/ast/rewriters/normalizeGraphReturnItemsTest.scala @@ -20,14 +20,14 @@ package org.neo4j.cypher.internal.compiler.v3_5.ast.rewriters import org.neo4j.cypher.internal.compiler.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.normalizeGraphReturnItems -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.{SignedDecimalIntegerLiteral, StringLiteral} +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.rewriting.rewriters.normalizeGraphReturnItems +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.{SignedDecimalIntegerLiteral, StringLiteral} class normalizeGraphReturnItemsTest extends CypherFunSuite with AstConstructionTestSupport { - import parser.ParserFixture._ + import org.opencypher.v9_0.parser.ParserFixture._ test("do not rename source graph") { val original = parser.parse("FROM GRAPH foo AT 'url' WITH * SOURCE GRAPH RETURN 1") diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/CachedFunctionTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/CachedFunctionTest.scala index be46fa4e20a05..c0b9561c28c78 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/CachedFunctionTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/CachedFunctionTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.compiler.v3_5.helpers import org.mockito.ArgumentMatchers._ import org.mockito.Mockito._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.ir.v3_5.QueryGraph class CachedFunctionTest extends CypherFunSuite { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/LazyIterableTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/LazyIterableTest.scala index 98d60d838c5b4..f9766be44dca7 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/LazyIterableTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/LazyIterableTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.helpers -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class LazyIterableTest extends CypherFunSuite { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/ScopeTestHelper.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/ScopeTestHelper.scala deleted file mode 100644 index 1443eab3917f2..0000000000000 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/ScopeTestHelper.scala +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * This file is part of Neo4j. - * - * Neo4j is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.neo4j.cypher.internal.compiler.v3_5.helpers - -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{Scope, Symbol, SymbolUse} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -object ScopeTestHelper { - - def symUse(name: String, offset: Int) = - SymbolUse(name, pos(offset)) - - def scope(entries: Symbol*)(children: Scope*): Scope = - Scope(entries.map { symbol => symbol.name -> symbol }.toMap, children.toSeq) - - def nodeSymbol(name: String, offsets: Int*): Symbol = - typedSymbol(name, TypeSpec.exact(CTNode), offsets: _*) - - def allSymbol(name: String, offsets: Int*): Symbol = - typedSymbol(name, TypeSpec.all, offsets: _*) - - def intSymbol(name: String, offsets: Int*): Symbol = - typedSymbol(name, TypeSpec.exact(CTInteger), offsets: _*) - - def stringSymbol(name: String, offsets: Int*): Symbol = - typedSymbol(name, TypeSpec.exact(CTString), offsets: _*) - - def intCollectionSymbol(name: String, offsets: Int*): Symbol = - typedSymbol(name, TypeSpec.exact(CTList(CTInteger)), offsets: _*) - - def pathCollectionSymbol(name: String, offsets: Int*): Symbol = - typedSymbol(name, TypeSpec.exact(CTList(CTPath)), offsets: _*) - - def intCollectionCollectionSymbol(name: String, offsets: Int*): Symbol = - typedSymbol(name, TypeSpec.exact(CTList(CTList(CTInteger))), offsets: _*) - - def typedSymbol(name: String, typeSpec: TypeSpec, offsets: Int*) = - Symbol(name, offsets.map(offset => pos(offset)).toSet, typeSpec) - - def pos(offset: Int): InputPosition = { - new InputPosition(offset, 1, offset + 1) - } -} diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/SemanticTableHelper.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/SemanticTableHelper.scala deleted file mode 100644 index 48b77cd85eb78..0000000000000 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/SemanticTableHelper.scala +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * This file is part of Neo4j. - * - * Neo4j is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.neo4j.cypher.internal.compiler.v3_5.helpers - -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable - -object SemanticTableHelper { - implicit class RichSemanticTable(table: SemanticTable) { - def transplantResolutionOnto(target: SemanticTable) = - target.copy( - resolvedLabelIds = table.resolvedLabelNames, - resolvedPropertyKeyNames = table.resolvedPropertyKeyNames, - resolvedRelTypeNames = table.resolvedRelTypeNames - ) - } -} diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/TreeZipperTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/TreeZipperTest.scala deleted file mode 100644 index 71fd862efcdd6..0000000000000 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/helpers/TreeZipperTest.scala +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * This file is part of Neo4j. - * - * Neo4j is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.neo4j.cypher.internal.compiler.v3_5.helpers - -import org.neo4j.cypher.internal.frontend.v3_5.helpers.{TreeElem, TreeZipper} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite - -class TreeZipperTest extends CypherFunSuite { - import Tapper._ - - case class TestElem(name: String, children: Seq[TestElem]) extends TreeElem[TestElem] { - def updateChildren(newChildren: Seq[TestElem]): TestElem = copy(children = newChildren.toVector) - } - - implicit object TestElemZipper extends TreeZipper[TestElem] - - val grandChild1 = TestElem("grandchild1", Seq()) - val grandChild2 = TestElem("grandchild2", Seq()) - val child1 = TestElem("child1", Seq(grandChild1, grandChild2)) - val child2 = TestElem("child2", Seq()) - val child3 = TestElem("child3", Seq()) - val child4 = TestElem("child4", Seq()) - val root = TestElem("parent", Seq(child1, child2, child3, child4)) - - test("Can get location in a single element tree") { - root.location.elem should equal(root) - } - - test("Can navigate to root of tree") { - root.location.down.down.up.up.elem.get should equal(root) - } - - test("Can navigate rightMost across children") { - root.location.down.rightMost.elem.get should equal(child4) - } - - test("Can navigate right across children") { - root.location - .down.tap { _.elem should equal(Some(child1)) } - .right.tap { _.elem should equal(Some(child2)) } - .right.tap { _.elem should equal(Some(child3)) } - .right.tap { _.elem should equal(Some(child4)) } - } - - test("Can navigate leftMost across children") { - root.location.down.right.right.right.leftMost.elem should equal(Some(child1)) - } - - test("Can navigate left across children") { - root.location - .down.rightMost.tap { _.elem should equal(Some(child4)) } - .left.tap { _.elem should equal(Some(child3)) } - .left.tap { _.elem should equal(Some(child2)) } - .left.tap { _.elem should equal(Some(child1)) } - } - - test("Correctly infers tree structure") { - def assertRole(location: TestElemZipper.Location, isRoot: Boolean, isLeftMost: Boolean, isRightMost: Boolean, isLeaf: Boolean): Unit = { - location.isRoot should equal(isRoot) - location.isLeftMost should equal(isLeftMost) - location.isRightMost should equal(isRightMost) - location.isLeaf should equal(isLeaf) - location.root.elem should equal(root) - } - - root - // root - .location.tap { assertRole(_, isRoot = true, isLeftMost = true, isRightMost = true, isLeaf = false) } - - // child1 - .down.tapSomeOrFail { assertRole(_, isRoot = false, isLeftMost = true, isRightMost = false, isLeaf = false) } - - // grandchild1 - .down.tapSomeOrFail { assertRole(_, isRoot = false, isLeftMost = true, isRightMost = false, isLeaf = true) } - - // grandchild2 - .right.tapSomeOrFail { assertRole(_, isRoot = false, isLeftMost = false, isRightMost = true, isLeaf = true) } - - // child1 - .up.tapSomeOrFail { assertRole(_, isRoot = false, isLeftMost = true, isRightMost = false, isLeaf = false) } - - // child2 - .right.tapSomeOrFail { assertRole(_, isRoot = false, isLeftMost = false, isRightMost = false, isLeaf = true) } - - // child3 - .right.tapSomeOrFail { assertRole(_, isRoot = false, isLeftMost = false, isRightMost = false, isLeaf = true) } - - // child3 - .right.tapSomeOrFail { assertRole(_, isRoot = false, isLeftMost = false, isRightMost = true, isLeaf = true) } - } - - test("Can replace elem without siblings") { - val newElem = TestElem("updated", Seq()) - - val updatedRoot = root.location.replace(newElem) - - updatedRoot.elem should equal(newElem) - } - - test("Can replace elem with siblings") { - val newElem = TestElem("updated", Seq()) - - val updatedRoot = root.location.down.right.right.get.replace(newElem).root - - updatedRoot.elem.children should equal(Seq(child1, child2, newElem, child4)) - } - - test("Can add new elem to left") { - val newElem = TestElem("child0", Seq()) - - val child2Location = root.location.down.right.get - val newChildLocation = child2Location.insertLeft(newElem).get - newChildLocation.elem should equal(newElem) - val updatedRoot = newChildLocation.root.elem - - updatedRoot should not equal root - updatedRoot.children should equal(Seq(child1, newElem, child2, child3, child4)) - } - - test("Can add new elem to left of leftMost") { - val newElem = TestElem("child0", Seq()) - - val child1Location = root.location.down.get - val newChildLocation = child1Location.insertLeft(newElem).get - newChildLocation.elem should equal(newElem) - val updatedRoot = newChildLocation.root.elem - - updatedRoot should not equal root - updatedRoot.children should equal(Seq(newElem, child1, child2, child3, child4)) - } - - test("Can add new elem to right") { - val newElem = TestElem("child0", Seq()) - - val child1Location = root.location.down.get - val newChildLocation = child1Location.insertRight(newElem).get - newChildLocation.elem should equal(newElem) - val updatedRoot = newChildLocation.root.elem - - updatedRoot should not equal root - updatedRoot.children should equal(Seq(child1, newElem, child2, child3, child4)) - } - - test("Can add new elem to right of rightMost") { - val newElem = TestElem("child0", Seq()) - - val child4Location = root.location.down.rightMost.get - val newChildLocation = child4Location.insertRight(newElem).get - newChildLocation.elem should equal(newElem) - val updatedRoot = newChildLocation.root.elem - - updatedRoot should not equal root - updatedRoot.children should equal(Seq(child1, child2, child3, child4, newElem)) - } - - test("Can add new only child") { - val newElem = TestElem("child0", Seq()) - - val newChildLocation = root.location.down.right.get.insertChild(newElem) - newChildLocation.elem should equal(newElem) - val updatedRootLocation = newChildLocation.root - - updatedRootLocation.elem should not equal root - - val updatedChild2 = updatedRootLocation.down.right.get.elem - updatedChild2 should not equal child2 - updatedChild2.name should equal(child2.name) - updatedChild2.children should equal(Seq(newElem)) - } - - test("Can add new child to existing children") { - val newElem = TestElem("child0", Seq()) - - val newChildLocation = root.location.insertChild(newElem) - newChildLocation.elem should equal(newElem) - val updatedRoot = newChildLocation.root.elem - - updatedRoot should not equal root - updatedRoot.children should equal(Seq(child1, child2, child3, child4, newElem)) - } -} diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/parser/ParserFixture.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/parser/ParserFixture.scala deleted file mode 100644 index f5fc9511ff14b..0000000000000 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/parser/ParserFixture.scala +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * This file is part of Neo4j. - * - * Neo4j is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.neo4j.cypher.internal.compiler.v3_5.parser - -import org.neo4j.cypher.internal.frontend.v3_5.parser.CypherParser -import org.scalatest.mock.MockitoSugar - -object ParserFixture extends MockitoSugar { - - def parse(a: String) = parser.parse(a) - - val parser = new CypherParser -} diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/parser/PeriodicCommitHintTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/parser/PeriodicCommitHintTest.scala index 268fe78b42a99..ef8c7a5b9722a 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/parser/PeriodicCommitHintTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/parser/PeriodicCommitHintTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.parser -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.frontend.v3_5.ast -import org.neo4j.cypher.internal.frontend.v3_5.parser.{ParserTest, Query} -import org.neo4j.cypher.internal.v3_5.expressions.SignedDecimalIntegerLiteral +import org.opencypher.v9_0.ast +import org.opencypher.v9_0.expressions.SignedDecimalIntegerLiteral +import org.opencypher.v9_0.parser.{ParserTest, Query} +import org.opencypher.v9_0.util.DummyPosition import org.parboiled.scala._ class PeriodicCommitHintTest extends ParserTest[ast.PeriodicCommitHint, Any] with Query { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/AssertionsShouldBeEnabledTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/AssertionsShouldBeEnabledTest.scala index 46da8d81280db..d509bdee70a21 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/AssertionsShouldBeEnabledTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/AssertionsShouldBeEnabledTest.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.phases -import org.neo4j.cypher.internal.util.v3_5.AssertionRunner.{Thunk, runUnderAssertion} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.AssertionRunner.{Thunk, runUnderAssertion} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class AssertionsShouldBeEnabledTest extends CypherFunSuite { test("tests should be run with assertions enabled") { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/StatsDivergenceCalculatorTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/StatsDivergenceCalculatorTest.scala index ad3090ffbff14..e648c2bef8a14 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/StatsDivergenceCalculatorTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/phases/StatsDivergenceCalculatorTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.compiler.v3_5.phases import org.neo4j.cypher.internal.compiler.v3_5.StatsDivergenceCalculator -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.factory.GraphDatabaseSettings import org.neo4j.kernel.configuration.Settings diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/AstRewritingTestSupport.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/AstRewritingTestSupport.scala index cf80dcb364d0f..ee395e4e7f305 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/AstRewritingTestSupport.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/AstRewritingTestSupport.scala @@ -19,13 +19,14 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner -import org.neo4j.cypher.internal.compiler.v3_5.parser.ParserFixture -import org.neo4j.cypher.internal.frontend.v3_5.ast.AstConstructionTestSupport -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherTestSupport import org.neo4j.cypher.internal.ir.v3_5.PlannerQuery import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.Cardinality -import org.neo4j.cypher.internal.util.v3_5.attribution.{Id, SequentialIdGen} +import org.opencypher.v9_0.ast.AstConstructionTestSupport +import org.opencypher.v9_0.parser.ParserFixture +import org.opencypher.v9_0.util.Cardinality +import org.opencypher.v9_0.util.attribution.{Id, SequentialIdGen} +import org.opencypher.v9_0.util.test_helpers.CypherTestSupport + import scala.language.implicitConversions trait LogicalPlanConstructionTestSupport extends CypherTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/CheckForUnresolvedTokensTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/CheckForUnresolvedTokensTest.scala index 8abb7cf135874..5646fa87694cc 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/CheckForUnresolvedTokensTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/CheckForUnresolvedTokensTest.scala @@ -21,13 +21,12 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner import org.neo4j.cypher.internal.compiler.v3_5.phases.LogicalPlanState import org.neo4j.cypher.internal.compiler.v3_5.test_helpers.ContextHelper -import org.neo4j.cypher.internal.frontend.v3_5.ast.Query -import org.neo4j.cypher.internal.frontend.v3_5.notification.{InternalNotification, MissingLabelNotification, MissingPropertyNameNotification, MissingRelTypeNotification} -import org.neo4j.cypher.internal.frontend.v3_5.phases.RecordingNotificationLogger -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.Query +import org.opencypher.v9_0.frontend.phases.RecordingNotificationLogger +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.planner.v3_5.spi.IDPPlannerName -import org.neo4j.cypher.internal.util.v3_5.{InputPosition, LabelId, PropertyKeyId, RelTypeId} +import org.opencypher.v9_0.util._ class CheckForUnresolvedTokensTest extends CypherFunSuite with AstRewritingTestSupport with LogicalPlanConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/DbStructureGraphStatistics.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/DbStructureGraphStatistics.scala index ec2aeb12dee73..e0579f9681161 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/DbStructureGraphStatistics.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/DbStructureGraphStatistics.scala @@ -20,12 +20,12 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner import org.neo4j.cypher.internal.planner.v3_5.spi.{GraphStatistics, IndexDescriptor} -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, LabelId, RelTypeId, Selectivity} +import org.opencypher.v9_0.util.{Cardinality, LabelId, RelTypeId, Selectivity} import org.neo4j.kernel.impl.util.dbstructure.DbStructureLookup class DbStructureGraphStatistics(lookup: DbStructureLookup) extends GraphStatistics { - import org.neo4j.cypher.internal.util.v3_5.NameId._ + import org.opencypher.v9_0.util.NameId._ override def nodesWithLabelCardinality( label: Option[LabelId] ): Cardinality = Cardinality(lookup.nodesWithLabelCardinality(label)) diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/DbStructureLogicalPlanningConfiguration.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/DbStructureLogicalPlanningConfiguration.scala index 040c055479bbb..5ddd43051d965 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/DbStructureLogicalPlanningConfiguration.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/DbStructureLogicalPlanningConfiguration.scala @@ -22,9 +22,9 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner import java.util import org.neo4j.cypher.internal.compiler.v3_5.CypherCompilerConfiguration -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.planner.v3_5.spi.{GraphStatistics, StatisticsCompletingGraphStatistics} -import org.neo4j.cypher.internal.util.v3_5.{LabelId, PropertyKeyId, RelTypeId} +import org.opencypher.v9_0.util.{LabelId, PropertyKeyId, RelTypeId} import org.neo4j.helpers.collection.{Pair, Visitable} import org.neo4j.kernel.impl.util.dbstructure.{DbStructureCollector, DbStructureLookup, DbStructureVisitor} diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/HardcodedGraphStatistics.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/HardcodedGraphStatistics.scala index 60e63c2a3f7f4..c54e10f3abbcb 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/HardcodedGraphStatistics.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/HardcodedGraphStatistics.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner import org.neo4j.cypher.internal.planner.v3_5.spi.{GraphStatistics, IndexDescriptor} -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, LabelId, RelTypeId, Selectivity} +import org.opencypher.v9_0.util.{Cardinality, LabelId, RelTypeId, Selectivity} case object HardcodedGraphStatistics extends GraphStatistics { val NODES_CARDINALITY = Cardinality(10000) diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/LogicalPlanningConfiguration.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/LogicalPlanningConfiguration.scala index 3f5836b632c7d..72482ba399d63 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/LogicalPlanningConfiguration.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/LogicalPlanningConfiguration.scala @@ -21,11 +21,11 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.ExpressionEvaluator import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5.{PlannerQuery, QueryGraph} import org.neo4j.cypher.internal.planner.v3_5.spi.GraphStatistics import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, Cost, LabelId, PropertyKeyId} +import org.opencypher.v9_0.util.{Cardinality, Cost, LabelId, PropertyKeyId} import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan trait LogicalPlanningConfiguration { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/LogicalPlanningTestSupport.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/LogicalPlanningTestSupport.scala index cea86f35237b0..df1c759922715 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/LogicalPlanningTestSupport.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/LogicalPlanningTestSupport.scala @@ -31,22 +31,22 @@ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.idp._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.{LogicalPlanProducer, devNullListener} import org.neo4j.cypher.internal.compiler.v3_5.test_helpers.ContextHelper -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters._ -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.RewriterStepSequencer -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.RewriterStepSequencer.newPlain -import org.neo4j.cypher.internal.frontend.v3_5.parser.CypherParser -import org.neo4j.cypher.internal.frontend.v3_5.phases._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} import org.neo4j.cypher.internal.planner.v3_5.spi.{CostBasedPlannerName, GraphStatistics, PlanContext} -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.{CypherFunSuite, CypherTestSupport} -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, LabelId, PropertyKeyId, RelTypeId} -import org.neo4j.cypher.internal.v3_5.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans._ +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.ast.semantics.SemanticTable +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.frontend.phases._ +import org.opencypher.v9_0.parser.CypherParser +import org.opencypher.v9_0.rewriting.RewriterStepSequencer +import org.opencypher.v9_0.rewriting.rewriters._ +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.{CypherFunSuite, CypherTestSupport} +import org.opencypher.v9_0.util.{Cardinality, LabelId, PropertyKeyId, RelTypeId} +import org.opencypher.v9_0.rewriting.RewriterStepSequencer.newPlain import scala.collection.mutable diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/LogicalPlanningTestSupport2.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/LogicalPlanningTestSupport2.scala index a8011c56004dc..0c7cdef9c4202 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/LogicalPlanningTestSupport2.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/LogicalPlanningTestSupport2.scala @@ -30,24 +30,23 @@ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter.un import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.{LogicalPlanProducer, devNullListener} import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{LogicalPlanningContext, _} import org.neo4j.cypher.internal.compiler.v3_5.test_helpers.ContextHelper -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters._ -import org.neo4j.cypher.internal.frontend.v3_5.helpers.fixedPoint -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.RewriterStepSequencer -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.RewriterStepSequencer.newPlain -import org.neo4j.cypher.internal.frontend.v3_5.parser.CypherParser -import org.neo4j.cypher.internal.frontend.v3_5.phases._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.rewriting.rewriters._ +import org.opencypher.v9_0.frontend.phases._ +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.planner.v3_5.spi.{GraphStatistics, IDPPlannerName, IndexDescriptor} -import org.neo4j.cypher.internal.util.v3_5.attribution.SequentialIdGen -import org.neo4j.cypher.internal.util.v3_5.attribution.{Attribute, Attributes} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.{CypherFunSuite, CypherTestSupport} -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, PropertyKeyId} -import org.neo4j.cypher.internal.v3_5.expressions.PatternExpression +import org.opencypher.v9_0.rewriting.RewriterStepSequencer.newPlain +import org.opencypher.v9_0.util.attribution.{Attribute, Attributes} +import org.opencypher.v9_0.util.test_helpers.{CypherFunSuite, CypherTestSupport} +import org.opencypher.v9_0.util.{Cardinality, PropertyKeyId} +import org.opencypher.v9_0.expressions.PatternExpression import org.neo4j.cypher.internal.v3_5.logical.plans.{LogicalPlan, ProduceResult} import org.neo4j.helpers.collection.Visitable import org.neo4j.kernel.impl.util.dbstructure.DbStructureVisitor +import org.opencypher.v9_0.parser.CypherParser +import org.opencypher.v9_0.rewriting.RewriterStepSequencer +import org.opencypher.v9_0.util.helpers.fixedPoint import org.scalatest.matchers.{BeMatcher, MatchResult} import scala.language.reflectiveCalls @@ -264,7 +263,7 @@ trait LogicalPlanningTestSupport2 extends CypherTestSupport with AstConstruction semanticTable.resolvedPropertyKeyNames(label) def using[T <: LogicalPlan](implicit tag: ClassTag[T]): BeMatcher[LogicalPlan] = new BeMatcher[LogicalPlan] { - import org.neo4j.cypher.internal.util.v3_5.Foldable._ + import org.opencypher.v9_0.util.Foldable._ override def apply(actual: LogicalPlan): MatchResult = { val matches = actual.treeFold(false) { case lp if tag.runtimeClass.isInstance(lp) => acc => (true, None) diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/PlannerQueryTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/PlannerQueryTest.scala index 3a8c930bb3ba0..de333d3dac00e 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/PlannerQueryTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/PlannerQueryTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ast.{AstConstructionTestSupport, SortItem} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.{AstConstructionTestSupport, SortItem} import org.neo4j.cypher.internal.ir.v3_5._ -import org.neo4j.cypher.internal.v3_5.expressions.UnsignedDecimalIntegerLiteral +import org.opencypher.v9_0.expressions.UnsignedDecimalIntegerLiteral class PlannerQueryTest extends CypherFunSuite with AstConstructionTestSupport { test("pair map") { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/QueryGraphTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/QueryGraphTest.scala index fe9d508abd1c9..91acfc2f2c391 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/QueryGraphTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/QueryGraphTest.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection.BOTH -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection.BOTH +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.ir.v3_5.{PatternRelationship, QueryGraph, SimplePatternLength} class QueryGraphTest extends CypherFunSuite { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/RealLogicalPlanningConfiguration.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/RealLogicalPlanningConfiguration.scala index 6d97cbb8e17e1..c1629418860ab 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/RealLogicalPlanningConfiguration.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/RealLogicalPlanningConfiguration.scala @@ -22,11 +22,11 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner import org.neo4j.cypher.internal.compiler.v3_5.CypherCompilerConfiguration import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics.{CardinalityModel, QueryGraphCardinalityModel, QueryGraphSolverInput} import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{CardinalityCostModel, ExpressionEvaluator, Metrics, StatisticsBackedCardinalityModel} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5.{PlannerQuery, QueryGraph} import org.neo4j.cypher.internal.planner.v3_5.spi.GraphStatistics import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, Cost} +import org.opencypher.v9_0.util.{Cardinality, Cost} import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan case class RealLogicalPlanningConfiguration(cypherCompilerConfig: CypherCompilerConfiguration) diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/ResolveTokensTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/ResolveTokensTest.scala index 9800e6cad6e16..5592e51be515b 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/ResolveTokensTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/ResolveTokensTest.scala @@ -20,17 +20,17 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner import org.mockito.Mockito._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.{Match, Query, SingleQuery, Where, _} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.frontend._ +import org.opencypher.v9_0.ast.{Match, Query, SingleQuery, Where, _} +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.planner.v3_5.spi.PlanContext -import org.neo4j.cypher.internal.util.v3_5.{LabelId, PropertyKeyId, RelTypeId} -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.{LabelId, PropertyKeyId, RelTypeId} +import org.opencypher.v9_0.expressions._ class ResolveTokensTest extends CypherFunSuite { - import org.neo4j.cypher.internal.compiler.v3_5.parser.ParserFixture._ + import org.opencypher.v9_0.parser.ParserFixture._ parseTest("match (n) where n.name = 'Resolved' return *") { query => implicit val semanticTable = SemanticTable() diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/SelectionsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/SelectionsTest.scala index 3be68c1331eb4..2f43d39911e63 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/SelectionsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/SelectionsTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ast._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast._ import org.neo4j.cypher.internal.ir.v3_5.{Predicate, Selections} -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ class SelectionsTest extends CypherFunSuite with LogicalPlanningTestSupport with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/SemanticTableBuilder.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/SemanticTableBuilder.scala index 603bdb9597571..dfabbc7fa406f 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/SemanticTableBuilder.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/SemanticTableBuilder.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner -import org.neo4j.cypher.internal.frontend.v3_5.ast.ASTAnnotationMap -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{ExpressionTypeInfo, SemanticTable} -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.ast.ASTAnnotationMap +import org.opencypher.v9_0.ast.semantics.{ExpressionTypeInfo, SemanticTable} +import org.opencypher.v9_0.expressions.Expression object SemanticTableBuilder { def apply() = new SemanticTableBuilder diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/SemanticTableTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/SemanticTableTest.scala index 471caea5f34a9..bbd1f2718c1ac 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/SemanticTableTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/SemanticTableTest.scala @@ -19,12 +19,12 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.util.v3_5.{InputPosition, InternalException} -import org.neo4j.cypher.internal.frontend.v3_5.ast.{ASTAnnotationMap, AstConstructionTestSupport} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{ExpressionTypeInfo, SemanticTable} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, Variable} +import org.opencypher.v9_0.ast.{ASTAnnotationMap, AstConstructionTestSupport} +import org.opencypher.v9_0.ast.semantics.{ExpressionTypeInfo, SemanticTable} +import org.opencypher.v9_0.expressions.{Expression, Variable} +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.{InputPosition, InternalException} class SemanticTableTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/StubbedLogicalPlanningConfiguration.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/StubbedLogicalPlanningConfiguration.scala index 458f6bef164f6..9e913df5a1a1a 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/StubbedLogicalPlanningConfiguration.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/StubbedLogicalPlanningConfiguration.scala @@ -21,13 +21,13 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.ExpressionEvaluator import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics.{CardinalityModel, QueryGraphCardinalityModel, QueryGraphSolverInput} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.planner.v3_5.spi.GraphStatistics import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, Cost, LabelId, Selectivity} +import org.opencypher.v9_0.util.{Cardinality, Cost, LabelId, Selectivity} import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, HasLabels} +import org.opencypher.v9_0.expressions.{Expression, HasLabels} class StubbedLogicalPlanningConfiguration(val parent: LogicalPlanningConfiguration) extends LogicalPlanningConfiguration with LogicalPlanningConfigurationAdHocSemanticTable { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/UpdateGraphTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/UpdateGraphTest.scala index d6f3fde3eb6b4..d25dc79268674 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/UpdateGraphTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/UpdateGraphTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.DummyPosition +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.ir.v3_5._ -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ class UpdateGraphTest extends CypherFunSuite { private val pos = DummyPosition(0) diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/ArgumentPlanningIntegrationTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/ArgumentPlanningIntegrationTest.scala index 23ff98182aee4..3f12ae79ea211 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/ArgumentPlanningIntegrationTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/ArgumentPlanningIntegrationTest.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SignedDecimalIntegerLiteral +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SignedDecimalIntegerLiteral import org.neo4j.cypher.internal.v3_5.logical.plans.{Argument, Projection} class ArgumentPlanningIntegrationTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/BenchmarkCardinalityEstimationTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/BenchmarkCardinalityEstimationTest.scala index 8f276bbef1bd6..86f080209780d 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/BenchmarkCardinalityEstimationTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/BenchmarkCardinalityEstimationTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.kernel.impl.util.dbstructure.QMULDbStructure class BenchmarkCardinalityEstimationTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CardinalityCostModelTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CardinalityCostModelTest.scala index 2470268285984..8eb72032531ad 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CardinalityCostModelTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CardinalityCostModelTest.scala @@ -23,9 +23,9 @@ import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSuppor import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics.QueryGraphSolverInput import org.neo4j.cypher.internal.ir.v3_5.LazyMode import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities -import org.neo4j.cypher.internal.util.v3_5.Cost -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.{HasLabels, LabelName, SemanticDirection} +import org.opencypher.v9_0.util.Cost +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.{HasLabels, LabelName, SemanticDirection} import org.neo4j.cypher.internal.v3_5.logical.plans._ class CardinalityCostModelTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CardinalitySupport.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CardinalitySupport.scala index 39604590b9d01..7326e6310a927 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CardinalitySupport.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CardinalitySupport.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical -import org.neo4j.cypher.internal.util.v3_5.Cardinality +import org.opencypher.v9_0.util.Cardinality import org.scalautils.{Equality, Tolerance, TripleEquals} object CardinalitySupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CartesianProductPlanningIntegrationTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CartesianProductPlanningIntegrationTest.scala index 317de633370e8..940933b738a8f 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CartesianProductPlanningIntegrationTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CartesianProductPlanningIntegrationTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.planner.BeLikeMatcher._ import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.ir.v3_5.RegularPlannerQuery import org.neo4j.cypher.internal.v3_5.logical.plans.{AllNodesScan, CartesianProduct, NodeByLabelScan, Selection} diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CreateNodePlanningIntegrationTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CreateNodePlanningIntegrationTest.scala index 64cb872544424..a4c9d0ba58e01 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CreateNodePlanningIntegrationTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CreateNodePlanningIntegrationTest.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.{MapExpression, PropertyKeyName, SignedDecimalIntegerLiteral} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.{MapExpression, PropertyKeyName, SignedDecimalIntegerLiteral} import org.neo4j.cypher.internal.v3_5.logical.plans._ class CreateNodePlanningIntegrationTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CreateRelationshipPlanningIntegrationTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CreateRelationshipPlanningIntegrationTest.scala index 91378e8048fe5..8d0dd6bb0bd3a 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CreateRelationshipPlanningIntegrationTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/CreateRelationshipPlanningIntegrationTest.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.{RelTypeName, Variable} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.{RelTypeName, Variable} import org.neo4j.cypher.internal.v3_5.logical.plans._ class CreateRelationshipPlanningIntegrationTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/DefaultQueryPlannerTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/DefaultQueryPlannerTest.scala index 818f9d7c752b2..cebac6d5c0dd5 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/DefaultQueryPlannerTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/DefaultQueryPlannerTest.scala @@ -21,20 +21,20 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.mockito.ArgumentMatchers.any import org.mockito.Mockito.{times, verify, when} -import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics.QueryGraphSolverInput import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.{LogicalPlanProducer, devNullListener} -import org.neo4j.cypher.internal.frontend.v3_5.ast.{ASTAnnotationMap, Hint} -import org.neo4j.cypher.internal.frontend.v3_5.phases.devNullLogger -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{ExpressionTypeInfo, SemanticTable} import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.planner.v3_5.spi.PlanContext -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} import org.neo4j.cypher.internal.v3_5.logical.plans.{Argument, LogicalPlan, ProduceResult, Projection} +import org.opencypher.v9_0.ast.semantics.{ExpressionTypeInfo, SemanticTable} +import org.opencypher.v9_0.ast.{ASTAnnotationMap, Hint} +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.frontend.phases.devNullLogger +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class DefaultQueryPlannerTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/ExpandPlanningIntegrationTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/ExpandPlanningIntegrationTest.scala index a4ca2c54308f9..90499e58d832d 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/ExpandPlanningIntegrationTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/ExpandPlanningIntegrationTest.scala @@ -19,13 +19,13 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner.BeLikeMatcher._ import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 import org.neo4j.cypher.internal.ir.v3_5.{PlannerQuery, RegularPlannerQuery} -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, LabelId, PropertyKeyId} +import org.opencypher.v9_0.util.{Cardinality, LabelId, PropertyKeyId} import org.neo4j.cypher.internal.v3_5.logical.plans._ -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ class ExpandPlanningIntegrationTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/FindShortestPathsPlanningIntegrationTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/FindShortestPathsPlanningIntegrationTest.scala index d991daa3a9fd5..c40c3a0cf2c50 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/FindShortestPathsPlanningIntegrationTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/FindShortestPathsPlanningIntegrationTest.scala @@ -20,10 +20,10 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.v3_5.logical.plans._ -import org.neo4j.cypher.internal.v3_5.expressions.{Equals, Not, SemanticDirection, Variable} +import org.opencypher.v9_0.expressions.{Equals, Not, SemanticDirection, Variable} class FindShortestPathsPlanningIntegrationTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/LeafPlanningIntegrationTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/LeafPlanningIntegrationTest.scala index 05022480360c9..20f85df2d1a74 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/LeafPlanningIntegrationTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/LeafPlanningIntegrationTest.scala @@ -22,14 +22,14 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.planner.BeLikeMatcher._ import org.neo4j.cypher.internal.compiler.v3_5.planner.{LogicalPlanningTestSupport2, StubbedLogicalPlanningConfiguration} import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics.QueryGraphSolverInput -import org.neo4j.cypher.internal.frontend.v3_5.ast._ +import org.opencypher.v9_0.ast._ import org.neo4j.cypher.internal.ir.v3_5.RegularPlannerQuery import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities -import org.neo4j.cypher.internal.util.v3_5._ -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection.INCOMING -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util._ +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection.INCOMING +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans.{Union, _} class LeafPlanningIntegrationTest extends CypherFunSuite with LogicalPlanningTestSupport2 with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/MergeNodePlanningIntegrationTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/MergeNodePlanningIntegrationTest.scala index 1b7b46e22732c..0d20221904e9e 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/MergeNodePlanningIntegrationTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/MergeNodePlanningIntegrationTest.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans._ class MergeNodePlanningIntegrationTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/MergeRelationshipPlanningIntegrationTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/MergeRelationshipPlanningIntegrationTest.scala index 2ce51f75c7478..1d193eefde0cd 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/MergeRelationshipPlanningIntegrationTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/MergeRelationshipPlanningIntegrationTest.scala @@ -20,9 +20,9 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection.OUTGOING -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection.OUTGOING +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans._ class MergeRelationshipPlanningIntegrationTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/NamedPathProjectionPlanningIntegrationTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/NamedPathProjectionPlanningIntegrationTest.scala index 824d72bfe3e5a..de6402202fd47 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/NamedPathProjectionPlanningIntegrationTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/NamedPathProjectionPlanningIntegrationTest.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 import org.neo4j.cypher.internal.v3_5.logical.plans.{Expand, NodeByLabelScan, Projection, Selection} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ class NamedPathProjectionPlanningIntegrationTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/NodeHashJoinPlanningIntegrationTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/NodeHashJoinPlanningIntegrationTest.scala index 4cb79e3719b2c..1d399e87de37a 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/NodeHashJoinPlanningIntegrationTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/NodeHashJoinPlanningIntegrationTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 import org.neo4j.cypher.internal.ir.v3_5.RegularPlannerQuery -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans._ class NodeHashJoinPlanningIntegrationTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/OptionalMatchPlanningIntegrationTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/OptionalMatchPlanningIntegrationTest.scala index 39d4eaa96efb3..205ccb1055ec9 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/OptionalMatchPlanningIntegrationTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/OptionalMatchPlanningIntegrationTest.scala @@ -23,10 +23,10 @@ import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSuppor import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter.unnestOptional import org.neo4j.cypher.internal.ir.v3_5.SimplePatternLength import org.neo4j.cypher.internal.planner.v3_5.spi.DelegatingGraphStatistics -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, LabelId, RelTypeId} -import org.neo4j.cypher.internal.util.v3_5.Foldable._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.{Cardinality, LabelId, RelTypeId} +import org.opencypher.v9_0.util.Foldable._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans.{Limit, _} import org.neo4j.kernel.impl.util.dbstructure.DbStructureLargeOptionalMatchStructure diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/OptionalMatchRemoverTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/OptionalMatchRemoverTest.scala index 5064421b2a58c..c7509849801b9 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/OptionalMatchRemoverTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/OptionalMatchRemoverTest.scala @@ -19,19 +19,19 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical -import org.neo4j.cypher.internal.util.v3_5.Rewritable._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.util.v3_5.{DummyPosition, Rewriter} +import org.opencypher.v9_0.util.Rewritable._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.{DummyPosition, Rewriter} import org.neo4j.cypher.internal.compiler.v3_5.SyntaxExceptionCreator import org.neo4j.cypher.internal.compiler.v3_5.ast.convert.plannerQuery.StatementConverters.toUnionQuery import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.OptionalMatchRemover.smallestGraphIncluding -import org.neo4j.cypher.internal.frontend.v3_5.ast.Query -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.flattenBooleanOperators -import org.neo4j.cypher.internal.frontend.v3_5.helpers.fixedPoint -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticChecker, SemanticTable} +import org.opencypher.v9_0.ast.Query +import org.opencypher.v9_0.rewriting.rewriters.flattenBooleanOperators +import org.opencypher.v9_0.ast.semantics.{SemanticChecker, SemanticTable} import org.neo4j.cypher.internal.ir.v3_5._ -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection.BOTH +import org.opencypher.v9_0.expressions.SemanticDirection.BOTH +import org.opencypher.v9_0.util.helpers.fixedPoint class OptionalMatchRemoverTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PatternExpressionPatternElementNamerTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PatternExpressionPatternElementNamerTest.scala index e48b7fb04fe26..d35dd41f7b1dc 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PatternExpressionPatternElementNamerTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PatternExpressionPatternElementNamerTest.scala @@ -20,10 +20,10 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.PatternExpressionPatternElementNamer -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.rewriting.rewriters.PatternExpressionPatternElementNamer +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ class PatternExpressionPatternElementNamerTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PatternPredicatePlanningIntegrationTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PatternPredicatePlanningIntegrationTest.scala index 43a9ba2e7c338..0637387b3487a 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PatternPredicatePlanningIntegrationTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PatternPredicatePlanningIntegrationTest.scala @@ -22,9 +22,9 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.planner.BeLikeMatcher._ import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.ir.v3_5.{QueryGraph, RegularPlannerQuery} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection.OUTGOING -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection.OUTGOING +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans.{NestedPlanExpression, _} class PatternPredicatePlanningIntegrationTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PickBestPlanUsingHintsAndCostTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PickBestPlanUsingHintsAndCostTest.scala index ea9cd18d70038..d247a2446c467 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PickBestPlanUsingHintsAndCostTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PickBestPlanUsingHintsAndCostTest.scala @@ -19,16 +19,16 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.{LogicalPlanProducer, devNullListener, pickBestPlanUsingHintsAndCost} -import org.neo4j.cypher.internal.frontend.v3_5.ast.UsingIndexHint -import org.neo4j.cypher.internal.frontend.v3_5.phases.devNullLogger import org.neo4j.cypher.internal.ir.v3_5.PlannerQuery import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.Cost import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan -import org.neo4j.cypher.internal.v3_5.expressions.{LabelName, PropertyKeyName} +import org.opencypher.v9_0.ast.UsingIndexHint +import org.opencypher.v9_0.expressions.{LabelName, PropertyKeyName} +import org.opencypher.v9_0.frontend.phases.devNullLogger +import org.opencypher.v9_0.util.Cost +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class PickBestPlanUsingHintsAndCostTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanEventHorizonTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanEventHorizonTest.scala index b40638a018f88..c38dc0eac100e 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanEventHorizonTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanEventHorizonTest.scala @@ -20,11 +20,11 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.planner.{LogicalPlanningTestSupport2, ProcedureCallProjection} -import org.neo4j.cypher.internal.frontend.v3_5.ast.ProcedureResultItem +import org.opencypher.v9_0.ast.ProcedureResultItem import org.neo4j.cypher.internal.ir.v3_5.{RegularPlannerQuery, RegularQueryProjection} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.{Namespace, ProcedureName, SignedDecimalIntegerLiteral} +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.{Namespace, ProcedureName, SignedDecimalIntegerLiteral} import org.neo4j.cypher.internal.v3_5.logical.plans._ class PlanEventHorizonTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanRewritingPlanningIntegrationTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanRewritingPlanningIntegrationTest.scala index 21f3d47759c7a..20e18b5b770f3 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanRewritingPlanningIntegrationTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PlanRewritingPlanningIntegrationTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 -import org.neo4j.cypher.internal.v3_5.expressions.GetDegree -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection.OUTGOING +import org.opencypher.v9_0.expressions.GetDegree +import org.opencypher.v9_0.expressions.SemanticDirection.OUTGOING import org.neo4j.cypher.internal.v3_5.logical.plans.{AllNodesScan, Projection} class PlanRewritingPlanningIntegrationTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PriorityLeafPlannerListTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PriorityLeafPlannerListTest.scala index 8760c5da18119..5654868e6bad9 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PriorityLeafPlannerListTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/PriorityLeafPlannerListTest.scala @@ -23,7 +23,7 @@ import org.mockito.ArgumentMatchers.any import org.mockito.Mockito.{verify, verifyZeroInteractions, when} import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 import org.neo4j.cypher.internal.ir.v3_5.QueryGraph -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.v3_5.logical.plans.Argument class PriorityLeafPlannerListTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/QueryGraphConnectedComponentsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/QueryGraphConnectedComponentsTest.scala index 7ad121804b013..e06e0b8ccb071 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/QueryGraphConnectedComponentsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/QueryGraphConnectedComponentsTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.ast._ +import org.opencypher.v9_0.ast._ import org.neo4j.cypher.internal.ir.v3_5._ -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ class QueryGraphConnectedComponentsTest extends CypherFunSuite with AstConstructionTestSupport with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/QueryGraphProducer.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/QueryGraphProducer.scala index f05524ffffe15..8ba30815694f5 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/QueryGraphProducer.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/QueryGraphProducer.scala @@ -19,15 +19,15 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical -import org.neo4j.cypher.internal.util.v3_5.inSequence +import org.opencypher.v9_0.util.inSequence import org.neo4j.cypher.internal.compiler.v3_5._ import org.neo4j.cypher.internal.compiler.v3_5.phases.LogicalPlanState import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.compiler.v3_5.test_helpers.ContextHelper -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.{Query, Statement} -import org.neo4j.cypher.internal.frontend.v3_5.phases.LateAstRewriting -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticCheckResult, SemanticChecker, SemanticTable} +import org.opencypher.v9_0.rewriting.rewriters._ +import org.opencypher.v9_0.ast.{Query, Statement} +import org.opencypher.v9_0.frontend.phases.{CNFNormalizer, LateAstRewriting, Namespacer, rewriteEqualityToInPredicate} +import org.opencypher.v9_0.ast.semantics.{SemanticCheckResult, SemanticChecker, SemanticTable} import org.neo4j.cypher.internal.ir.v3_5.PlannerQuery import org.neo4j.cypher.internal.planner.v3_5.spi.IDPPlannerName import org.scalatest.mock.MockitoSugar diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/SolvablesTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/SolvablesTest.scala index 123896e8c844b..ab3abfd880354 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/SolvablesTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/SolvablesTest.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.ir.v3_5.{PatternRelationship, QueryGraph, SimplePatternLength} -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection class SolvablesTest extends CypherFunSuite { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/StatisticsBackedCardinalityModelTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/StatisticsBackedCardinalityModelTest.scala index 2bb3e371e34de..5483fecce465e 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/StatisticsBackedCardinalityModelTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/StatisticsBackedCardinalityModelTest.scala @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics.QueryGrap import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.cardinality.CardinalityModelTestHelper import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.cardinality.assumeIndependence.AssumeIndependenceQueryGraphCardinalityModel import org.neo4j.cypher.internal.planner.v3_5.spi.GraphStatistics -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class StatisticsBackedCardinalityModelTest extends CypherFunSuite with LogicalPlanningTestSupport with CardinalityModelTestHelper { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/UnionPlanningIntegrationTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/UnionPlanningIntegrationTest.scala index 6c651cc38c32a..4dd2d3f8cbb4e 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/UnionPlanningIntegrationTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/UnionPlanningIntegrationTest.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 -import org.neo4j.cypher.internal.v3_5.expressions.Variable +import org.opencypher.v9_0.expressions.Variable import org.neo4j.cypher.internal.v3_5.logical.plans.{Distinct, NodeByLabelScan, Projection, Union} class UnionPlanningIntegrationTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/WithPlanningIntegrationTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/WithPlanningIntegrationTest.scala index ab7d1d63d3c9c..2f01d42abd97e 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/WithPlanningIntegrationTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/WithPlanningIntegrationTest.scala @@ -21,9 +21,9 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 import org.neo4j.cypher.internal.ir.v3_5.{SimplePatternLength, VarPatternLength} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.{CypherFunSuite, WindowsStringSafe} -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection.OUTGOING -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.test_helpers.{CypherFunSuite, WindowsStringSafe} +import org.opencypher.v9_0.expressions.SemanticDirection.OUTGOING +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans._ class WithPlanningIntegrationTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/CardinalityModelTestHelper.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/CardinalityModelTestHelper.scala index c094ba673d14c..6d6f94c2826f6 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/CardinalityModelTestHelper.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/CardinalityModelTestHelper.scala @@ -23,8 +23,8 @@ import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSuppor import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics._ import org.neo4j.cypher.internal.planner.v3_5.spi.GraphStatistics -import org.neo4j.cypher.internal.util.v3_5.Cardinality -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.Cardinality +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite trait CardinalityModelTestHelper extends CardinalityTestHelper { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/CardinalityTestHelper.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/CardinalityTestHelper.scala index 279e19ba66190..bc392a73f30ac 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/CardinalityTestHelper.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/CardinalityTestHelper.scala @@ -20,17 +20,15 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.cardinality import org.neo4j.cypher.internal.compiler.v3_5.helpers.MapSupport._ -import org.neo4j.cypher.internal.compiler.v3_5.helpers.SemanticTableHelper import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.QueryGraphProducer -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable -import org.neo4j.cypher.internal.util.v3_5.Cardinality.NumericCardinality import org.neo4j.cypher.internal.ir.v3_5._ -import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} import org.neo4j.cypher.internal.planner.v3_5.spi.{GraphStatistics, IndexDescriptor} -import org.neo4j.cypher.internal.util.v3_5._ -import org.neo4j.cypher.internal.v3_5.expressions.Variable +import org.opencypher.v9_0.ast.semantics.SemanticTable +import org.opencypher.v9_0.expressions.Variable +import org.opencypher.v9_0.util.Cardinality.NumericCardinality +import org.opencypher.v9_0.util._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.scalatest.matchers.{MatchResult, Matcher} import scala.collection.mutable @@ -264,3 +262,14 @@ trait CardinalityCustomMatchers { new MapEqualityWithDouble[T](expected, tolerance)(NumericCardinality) } } + +object SemanticTableHelper { + implicit class RichSemanticTable(table: SemanticTable) { + def transplantResolutionOnto(target: SemanticTable): SemanticTable = + target.copy( + resolvedLabelIds = table.resolvedLabelNames, + resolvedPropertyKeyNames = table.resolvedPropertyKeyNames, + resolvedRelTypeNames = table.resolvedRelTypeNames + ) + } +} diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/ExpressionSelectivityCalculatorTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/ExpressionSelectivityCalculatorTest.scala index 74d476b587c7d..fb55c91ad8146 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/ExpressionSelectivityCalculatorTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/ExpressionSelectivityCalculatorTest.scala @@ -20,14 +20,14 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.cardinality import org.mockito.Mockito.when -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.util.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util._ +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.planner.v3_5.spi.{GraphStatistics, IndexDescriptor} -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ class ExpressionSelectivityCalculatorTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/RandomizedCardinalityModelTestSuite.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/RandomizedCardinalityModelTestSuite.scala index ef854107fc65c..04abe7c305152 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/RandomizedCardinalityModelTestSuite.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/RandomizedCardinalityModelTestSuite.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.cardinality import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport import org.neo4j.cypher.internal.compiler.v3_5.test_helpers.RandomizedTestSupport -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite abstract class RandomizedCardinalityModelTestSuite extends CypherFunSuite with RandomizedTestSupport with LogicalPlanningTestSupport with CardinalityModelTestHelper diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/SelectivityCombinerTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/SelectivityCombinerTest.scala index fad004ed179aa..55e798cdefbc9 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/SelectivityCombinerTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/SelectivityCombinerTest.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.cardinality -import org.neo4j.cypher.internal.util.v3_5.Selectivity -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.Selectivity +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class SelectivityCombinerTest extends CypherFunSuite { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/assumeIndependence/PatternSelectivityCalculatorTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/assumeIndependence/PatternSelectivityCalculatorTest.scala index c8409e554f7ba..0c77909f9bad4 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/assumeIndependence/PatternSelectivityCalculatorTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/cardinality/assumeIndependence/PatternSelectivityCalculatorTest.scala @@ -23,14 +23,14 @@ import org.mockito.ArgumentMatchers.any import org.mockito.Mockito._ import org.mockito.invocation.InvocationOnMock import org.mockito.stubbing.Answer -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.cardinality.IndependenceCombiner -import org.neo4j.cypher.internal.frontend.v3_5.ast.AstConstructionTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.AstConstructionTestSupport +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5.{VarPatternLength, _} import org.neo4j.cypher.internal.planner.v3_5.spi.GraphStatistics -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, LabelId, Selectivity} -import org.neo4j.cypher.internal.v3_5.expressions.{HasLabels, LabelName, SemanticDirection} +import org.opencypher.v9_0.util.{Cardinality, LabelId, Selectivity} +import org.opencypher.v9_0.expressions.{HasLabels, LabelName, SemanticDirection} import scala.collection.mutable diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/CartesianProductsOrValueJoinsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/CartesianProductsOrValueJoinsTest.scala index 22d1d528e58a8..b62e1f364c729 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/CartesianProductsOrValueJoinsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/CartesianProductsOrValueJoinsTest.scala @@ -19,14 +19,14 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.idp -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.v3_5.logical.plans._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.AstConstructionTestSupport +import org.opencypher.v9_0.ast.AstConstructionTestSupport import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.Cardinality -import org.neo4j.cypher.internal.v3_5.expressions.Equals +import org.opencypher.v9_0.util.Cardinality +import org.opencypher.v9_0.expressions.Equals class CartesianProductsOrValueJoinsTest extends CypherFunSuite with LogicalPlanningTestSupport2 with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/ExpandSolverStepTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/ExpandSolverStepTest.scala index 12356cbe6bc64..c11c9b06f5c88 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/ExpandSolverStepTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/ExpandSolverStepTest.scala @@ -20,22 +20,22 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.idp import org.mockito.Mockito._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics.CardinalityModel import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.LogicalPlanProducer import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{LogicalPlanningContext, Metrics, QueryGraphSolver} -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.phases.InternalNotificationLogger +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.frontend.phases.InternalNotificationLogger import org.neo4j.cypher.internal.v3_5.logical.plans.{Expand, ExpandAll, ExpandInto, LogicalPlan} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.planner.v3_5.spi.PlanContext -import org.neo4j.cypher.internal.util.v3_5.Cardinality -import org.neo4j.cypher.internal.util.v3_5.attribution.SequentialIdGen +import org.opencypher.v9_0.util.Cardinality +import org.opencypher.v9_0.util.attribution.SequentialIdGen import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 import org.neo4j.cypher.internal.ir.v3_5._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.cypher.internal.v3_5.logical.plans.{Expand, ExpandAll, ExpandInto, LogicalPlan} diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/IDPQueryGraphSolverTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/IDPQueryGraphSolverTest.scala index 7837f4105120a..ffd6f9ba8dbc4 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/IDPQueryGraphSolverTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/IDPQueryGraphSolverTest.scala @@ -22,10 +22,10 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.idp import org.mockito.Mockito.{times, verify, verifyNoMoreInteractions} import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 import org.neo4j.cypher.internal.ir.v3_5._ -import org.neo4j.cypher.internal.util.v3_5.Cardinality -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection.OUTGOING -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.Cardinality +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection.OUTGOING +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans._ import org.scalatest.exceptions.TestFailedException diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/IDPSolverTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/IDPSolverTest.scala index 18d65e20975ff..cad232d96a389 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/IDPSolverTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/IDPSolverTest.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.idp import org.mockito.Mockito.{spy, verify, verifyNoMoreInteractions} import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.ProjectingSelector import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Solveds -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import scala.collection.immutable.BitSet diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/IDPTableTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/IDPTableTest.scala index adf12720fe4a8..2f03033edb4c9 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/IDPTableTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/IDPTableTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.idp import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import scala.collection.immutable.BitSet diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/JoinSolverStepTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/JoinSolverStepTest.scala index 88cdc1a842196..d9b6b4098f785 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/JoinSolverStepTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/JoinSolverStepTest.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.idp import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.ir.v3_5._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.cypher.internal.v3_5.logical.plans.{LogicalPlan, NodeHashJoin} class JoinSolverStepTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/SingleComponentPlannerTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/SingleComponentPlannerTest.scala index f572114414142..c65c335e1c61d 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/SingleComponentPlannerTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/SingleComponentPlannerTest.scala @@ -19,14 +19,14 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.idp -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.ast._ +import org.opencypher.v9_0.ast._ import org.neo4j.cypher.internal.ir.v3_5.{PatternRelationship, QueryGraph, SimplePatternLength} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanContext import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Solveds import org.neo4j.cypher.internal.v3_5.logical.plans._ -import org.neo4j.cypher.internal.v3_5.expressions.{PropertyKeyName, SemanticDirection} +import org.opencypher.v9_0.expressions.{PropertyKeyName, SemanticDirection} class SingleComponentPlannerTest extends CypherFunSuite with LogicalPlanningTestSupport with AstConstructionTestSupport { test("plans expands for queries with single pattern rel") { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/extractPredicatesTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/extractPredicatesTest.scala index f17c9d2507361..3399eaac3ed84 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/extractPredicatesTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/idp/extractPredicatesTest.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.idp -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ import org.neo4j.graphdb.Direction class extractPredicatesTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/patternExpressionRewriterTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/patternExpressionRewriterTest.scala index 43870d0ca03d2..2145dce053e09 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/patternExpressionRewriterTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/patternExpressionRewriterTest.scala @@ -23,10 +23,10 @@ import org.mockito.Mockito.{verify, verifyNoMoreInteractions, when} import org.mockito.invocation.InvocationOnMock import org.mockito.stubbing.Answer import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.PatternExpressionPatternElementNamer +import org.opencypher.v9_0.rewriting.rewriters.PatternExpressionPatternElementNamer import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans.{AllNodesScan, LogicalPlan, NestedPlanExpression, Selection} class patternExpressionRewriterTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/AllNodesLeafPlannerTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/AllNodesLeafPlannerTest.scala index 5674479f158f5..b626c53a4c606 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/AllNodesLeafPlannerTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/AllNodesLeafPlannerTest.scala @@ -19,13 +19,13 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.ExpressionEvaluator import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.allNodesLeafPlanner import org.neo4j.cypher.internal.ir.v3_5.QueryGraph import org.neo4j.cypher.internal.v3_5.logical.plans.AllNodesScan -import org.neo4j.cypher.internal.v3_5.expressions.PatternExpression +import org.opencypher.v9_0.expressions.PatternExpression class AllNodesLeafPlannerTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/ArgumentLeafPlannerTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/ArgumentLeafPlannerTest.scala index 75b501d8621e4..24d13db2ac156 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/ArgumentLeafPlannerTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/ArgumentLeafPlannerTest.scala @@ -23,8 +23,8 @@ import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSuppor import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.argumentLeafPlanner import org.neo4j.cypher.internal.ir.v3_5.QueryGraph import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.PatternExpression +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.PatternExpression import org.neo4j.cypher.internal.v3_5.logical.plans.Argument class ArgumentLeafPlannerTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/IdSeekLeafPlannerTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/IdSeekLeafPlannerTest.scala index 8256e0a6c2d52..309b30d85db9f 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/IdSeekLeafPlannerTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/IdSeekLeafPlannerTest.scala @@ -20,20 +20,18 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans import org.mockito.Mockito._ -import org.neo4j.cypher.internal.util.v3_5.{Cost, RelTypeId, symbols} import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.ExpressionEvaluator import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics.QueryGraphSolverInput import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.idSeekLeafPlanner -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{ExpressionTypeInfo, SemanticTable} import org.neo4j.cypher.internal.ir.v3_5._ -import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} +import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities import org.neo4j.cypher.internal.v3_5.logical.plans._ -import org.neo4j.cypher.internal.v3_5.expressions._ - -import scala.collection.mutable +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.ast.semantics.{ExpressionTypeInfo, SemanticTable} +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.{Cost, RelTypeId, symbols} class IdSeekLeafPlannerTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/IndexLeafPlannerTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/IndexLeafPlannerTest.scala index a16ea9110120e..369a2decb7f0d 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/IndexLeafPlannerTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/IndexLeafPlannerTest.scala @@ -19,14 +19,14 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner.BeLikeMatcher._ import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.{indexSeekLeafPlanner, mergeUniqueIndexSeekLeafPlanner, uniqueIndexSeekLeafPlanner} -import org.neo4j.cypher.internal.frontend.v3_5.ast._ +import org.opencypher.v9_0.ast._ import org.neo4j.cypher.internal.ir.v3_5.{Predicate, QueryGraph, Selections} import org.neo4j.cypher.internal.v3_5.logical.plans._ -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ class IndexLeafPlannerTest extends CypherFunSuite with LogicalPlanningTestSupport2 with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/IndexScanLeafPlannerTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/IndexScanLeafPlannerTest.scala index 9e416b24d24b4..7be94c3197293 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/IndexScanLeafPlannerTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/IndexScanLeafPlannerTest.scala @@ -22,13 +22,13 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans import org.neo4j.cypher.internal.compiler.v3_5.planner.BeLikeMatcher._ import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.indexScanLeafPlanner -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ast.UsingIndexHint +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.UsingIndexHint import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Solveds import org.neo4j.cypher.internal.v3_5.logical.plans.{NodeIndexContainsScan, NodeIndexScan} -import org.neo4j.cypher.internal.v3_5.expressions._ -import org.neo4j.cypher.internal.v3_5.functions +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.expressions.functions class IndexScanLeafPlannerTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/IndexSeekLeafPlannerTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/IndexSeekLeafPlannerTest.scala index 1ef0dae55e3d6..a9032f9356a75 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/IndexSeekLeafPlannerTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/IndexSeekLeafPlannerTest.scala @@ -22,12 +22,12 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans import org.neo4j.cypher.internal.compiler.v3_5.planner.BeLikeMatcher._ import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.{indexSeekLeafPlanner, uniqueIndexSeekLeafPlanner} -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.ir.v3_5.{Predicate, QueryGraph, Selections} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Solveds import org.neo4j.cypher.internal.v3_5.logical.plans.{CompositeQueryExpression, NodeIndexSeek, NodeUniqueIndexSeek, SingleQueryExpression} -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ import scala.language.reflectiveCalls diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/InequalityRangeSeekableTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/InequalityRangeSeekableTest.scala index 54d87921661ec..247bc3a2af25c 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/InequalityRangeSeekableTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/InequalityRangeSeekableTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans -import org.neo4j.cypher.internal.util.v3_5.NonEmptyList -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.NonEmptyList +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans._ class InequalityRangeSeekableTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/LabelScanLeafPlannerTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/LabelScanLeafPlannerTest.scala index 1afc8f6a4b307..3c21f4c743268 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/LabelScanLeafPlannerTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/LabelScanLeafPlannerTest.scala @@ -20,17 +20,17 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans import org.mockito.Mockito._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.ExpressionEvaluator import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics.QueryGraphSolverInput import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps.labelScanLeafPlanner -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.{Cost, LabelId} +import org.opencypher.v9_0.util.{Cost, LabelId} import org.neo4j.cypher.internal.v3_5.logical.plans.{LogicalPlan, NodeByLabelScan} -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ class LabelScanLeafPlannerTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/LogicalPlanAssignedIdTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/LogicalPlanAssignedIdTest.scala index 9c6fec37047fa..22e738461b401 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/LogicalPlanAssignedIdTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/LogicalPlanAssignedIdTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.v3_5.logical.plans._ class LogicalPlanAssignedIdTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/LogicalPlanEqualityTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/LogicalPlanEqualityTest.scala index 8557e921c20f9..5be82bf0c54a3 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/LogicalPlanEqualityTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/LogicalPlanEqualityTest.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode -import org.neo4j.cypher.internal.util.v3_5.attribution.SequentialIdGen -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.attribution.SequentialIdGen +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan class LogicalPlanEqualityTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/LogicalPlanTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/LogicalPlanTest.scala index 5a94376fd972c..5f281bf327ac9 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/LogicalPlanTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/LogicalPlanTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.v3_5.logical.plans.{Apply, Argument} class LogicalPlanTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/SargableTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/SargableTest.scala index bfd22ed39a469..95b7fd7e66e3c 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/SargableTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/SargableTest.scala @@ -20,10 +20,10 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans import org.mockito.Mockito -import org.neo4j.cypher.internal.frontend.v3_5.ast._ +import org.opencypher.v9_0.ast._ import org.neo4j.cypher.internal.v3_5.logical.plans.{ManySeekableArgs, PrefixRange, SingleSeekableArg} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ class SargableTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/FuseSelectionsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/FuseSelectionsTest.scala index dd595ec604b7f..b70716543afcd 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/FuseSelectionsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/FuseSelectionsTest.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.ast.AstConstructionTestSupport -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.AstConstructionTestSupport +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.v3_5.logical.plans.{Argument, Selection} class FuseSelectionsTest extends CypherFunSuite with LogicalPlanningTestSupport with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/PredicateRemovalThroughJoinsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/PredicateRemovalThroughJoinsTest.scala index 1bc2e93d660d2..b69e69ffe8c85 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/PredicateRemovalThroughJoinsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/PredicateRemovalThroughJoinsTest.scala @@ -19,13 +19,13 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.Cardinality -import org.neo4j.cypher.internal.util.v3_5.attribution.Attributes -import org.neo4j.cypher.internal.v3_5.expressions.{Equals, Expression, SignedDecimalIntegerLiteral} +import org.opencypher.v9_0.util.Cardinality +import org.opencypher.v9_0.util.attribution.Attributes +import org.opencypher.v9_0.expressions.{Equals, Expression, SignedDecimalIntegerLiteral} import org.neo4j.cypher.internal.v3_5.logical.plans.{NodeHashJoin, Selection} class PredicateRemovalThroughJoinsTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/PruningVarExpanderTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/PruningVarExpanderTest.scala index 7692e234212a3..43246630b50e5 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/PruningVarExpanderTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/PruningVarExpanderTest.scala @@ -20,10 +20,10 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.ast._ +import org.opencypher.v9_0.ast._ import org.neo4j.cypher.internal.ir.v3_5.VarPatternLength -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans._ class PruningVarExpanderTest extends CypherFunSuite with LogicalPlanningTestSupport with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/SimplifyPredicatesTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/SimplifyPredicatesTest.scala index d55a39899cec5..3dd4c04d19484 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/SimplifyPredicatesTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/SimplifyPredicatesTest.scala @@ -20,9 +20,9 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport -import org.neo4j.cypher.internal.util.v3_5.NonEmptyList -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.NonEmptyList +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans.{Argument, LogicalPlan, Selection} class SimplifyPredicatesTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/SimplifySelectionsTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/SimplifySelectionsTest.scala index cfc9022f9bc9c..9d8d8f27bd8a2 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/SimplifySelectionsTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/SimplifySelectionsTest.scala @@ -20,10 +20,11 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter import org.neo4j.cypher.internal.compiler.v3_5.planner.{FakePlan, LogicalPlanningTestSupport} -import org.neo4j.cypher.internal.util.v3_5.symbols.CTAny -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.symbols.CTAny +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans.{DropResult, LogicalPlan, Selection} +import org.opencypher.v9_0.expressions.DummyExpression class SimplifySelectionsTest extends CypherFunSuite with LogicalPlanningTestSupport { test("should rewrite Selection(false, source) to DropResult(source)") { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/UnnestApplyTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/UnnestApplyTest.scala index 1d36fe8660def..a43d1f45aadfc 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/UnnestApplyTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/UnnestApplyTest.scala @@ -20,12 +20,12 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.helpers.fixedPoint +import org.opencypher.v9_0.util.helpers.fixedPoint import org.neo4j.cypher.internal.ir.v3_5.VarPatternLength import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Solveds -import org.neo4j.cypher.internal.util.v3_5.attribution.Attributes -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.attribution.Attributes +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.cypher.internal.v3_5.logical.plans._ class UnnestApplyTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/UnnestOptionalTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/UnnestOptionalTest.scala index eecd328f1ac15..af4cccfc4afa5 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/UnnestOptionalTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/UnnestOptionalTest.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport import org.neo4j.cypher.internal.ir.v3_5.VarPatternLength -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans._ class UnnestOptionalTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/UseTopTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/UseTopTest.scala index 26d084710a858..e0a3aac3e47e6 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/UseTopTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/UseTopTest.scala @@ -20,11 +20,10 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.ast.AstConstructionTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.helpers.fixedPoint -import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.AstConstructionTestSupport +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.v3_5.logical.plans._ +import org.opencypher.v9_0.util.helpers.fixedPoint class UseTopTest extends CypherFunSuite with LogicalPlanningTestSupport with AstConstructionTestSupport { private val leaf = newMockedLogicalPlan() diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/cleanUpEagerTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/cleanUpEagerTest.scala index 0016f3090e903..b0c1ba7e3e305 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/cleanUpEagerTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/cleanUpEagerTest.scala @@ -19,14 +19,13 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.helpers.fixedPoint import org.neo4j.cypher.internal.ir.v3_5.NoHeaders -import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Solveds -import org.neo4j.cypher.internal.util.v3_5.attribution.Attributes -import org.neo4j.cypher.internal.v3_5.expressions.StringLiteral import org.neo4j.cypher.internal.v3_5.logical.plans._ +import org.opencypher.v9_0.expressions.StringLiteral +import org.opencypher.v9_0.util.attribution.Attributes +import org.opencypher.v9_0.util.helpers.fixedPoint +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class cleanUpEagerTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/removeIdenticalPlansTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/removeIdenticalPlansTest.scala index 310ab39d5304f..0d79545e4e089 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/removeIdenticalPlansTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/plans/rewriter/removeIdenticalPlansTest.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.plans.rewriter import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.util.v3_5.attribution.Attributes +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.attribution.Attributes import org.neo4j.cypher.internal.v3_5.logical.plans.{AllNodesScan, NodeHashJoin} class removeIdenticalPlansTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/AggregationTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/AggregationTest.scala index 575b65ec653df..644872383d892 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/AggregationTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/AggregationTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.v3_5.logical.plans.{Aggregation, LogicalPlan, Projection} import org.neo4j.cypher.internal.ir.v3_5.AggregatingQueryProjection -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ class AggregationTest extends CypherFunSuite with LogicalPlanningTestSupport { val aggregatingMap: Map[String, Expression] = Map("count(*)" -> CountStar()(pos)) diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/ExtractBestPlanTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/ExtractBestPlanTest.scala index c79640cf93bd0..35a42ba802c51 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/ExtractBestPlanTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/ExtractBestPlanTest.scala @@ -21,17 +21,16 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps import org.mockito.ArgumentMatchers._ import org.mockito.Mockito._ -import org.neo4j.cypher.internal.util.v3_5.{HintException, IndexHintException, InternalException, JoinHintException} import org.neo4j.cypher.internal.compiler.v3_5.planner._ -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.notification.{IndexHintUnfulfillableNotification, JoinHintUnfulfillableNotification} -import org.neo4j.cypher.internal.frontend.v3_5.phases.RecordingNotificationLogger -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.ir.v3_5.{PatternRelationship, VarPatternLength, _} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} import org.neo4j.cypher.internal.planner.v3_5.spi.{IndexDescriptor, PlanContext} import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan -import org.neo4j.cypher.internal.v3_5.expressions.{LabelName, PatternExpression, PropertyKeyName, SemanticDirection} +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.expressions.{LabelName, PatternExpression, PropertyKeyName, SemanticDirection} +import org.opencypher.v9_0.frontend.phases.RecordingNotificationLogger +import org.opencypher.v9_0.util._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class ExtractBestPlanTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/LeftOuterHashJoinTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/LeftOuterHashJoinTest.scala index b46d15febf4b2..e7733f8184dfc 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/LeftOuterHashJoinTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/LeftOuterHashJoinTest.scala @@ -25,12 +25,12 @@ import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.ExpressionEvaluator import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics.QueryGraphSolverInput import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.idp.DefaultIDPSolverConfig -import org.neo4j.cypher.internal.frontend.v3_5.ast.{Hint, UsingJoinHint} +import org.opencypher.v9_0.ast.{Hint, UsingJoinHint} import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities -import org.neo4j.cypher.internal.util.v3_5.Cost -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.{PatternExpression, SemanticDirection, Variable} +import org.opencypher.v9_0.util.Cost +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.{PatternExpression, SemanticDirection, Variable} import org.neo4j.cypher.internal.v3_5.logical.plans.{AllNodesScan, LeftOuterHashJoin, LogicalPlan} class LeftOuterHashJoinTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/OrLeafPlannerTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/OrLeafPlannerTest.scala index 0b5abb673d0bc..89b2369cf43f6 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/OrLeafPlannerTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/OrLeafPlannerTest.scala @@ -22,13 +22,13 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps import org.mockito.ArgumentMatchers import org.mockito.ArgumentMatchers._ import org.mockito.Mockito._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{LeafPlanFromExpressions, LeafPlansForVariable, LogicalPlanningContext} import org.neo4j.cypher.internal.ir.v3_5.{QueryGraph, Selections} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} import org.neo4j.cypher.internal.v3_5.logical.plans.{Distinct, Union} -import org.neo4j.cypher.internal.v3_5.expressions.{Ors, Variable} +import org.opencypher.v9_0.expressions.{Ors, Variable} class OrLeafPlannerTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/PatternExpressionSolverTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/PatternExpressionSolverTest.scala index 35606bf880558..ce190618a62e7 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/PatternExpressionSolverTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/PatternExpressionSolverTest.scala @@ -19,13 +19,13 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.DummyPosition +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.QueryGraphSolver -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.v3_5.logical.plans.{Projection, RollUpApply} -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ class PatternExpressionSolverTest extends CypherFunSuite with LogicalPlanningTestSupport { test("Rewrites single pattern expression") { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/ProjectionTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/ProjectionTest.scala index d03fe044d0f1d..9c4b074f8b461 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/ProjectionTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/ProjectionTest.scala @@ -21,13 +21,13 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.LogicalPlanningContext -import org.neo4j.cypher.internal.frontend.v3_5.ast -import org.neo4j.cypher.internal.frontend.v3_5.ast.AscSortItem -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast +import org.opencypher.v9_0.ast.AscSortItem +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.Cardinality -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.Cardinality +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans.{Ascending, ColumnOrder, LogicalPlan, Projection} class ProjectionTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/RightOuterHashJoinTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/RightOuterHashJoinTest.scala index 6a245978d0777..6661d0a6351af 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/RightOuterHashJoinTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/RightOuterHashJoinTest.scala @@ -23,12 +23,12 @@ import org.mockito.Mockito._ import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.ExpressionEvaluator import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics.QueryGraphSolverInput -import org.neo4j.cypher.internal.frontend.v3_5.ast.{Hint, UsingJoinHint} +import org.opencypher.v9_0.ast.{Hint, UsingJoinHint} import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities -import org.neo4j.cypher.internal.util.v3_5.Cost -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.{PatternExpression, SemanticDirection, Variable} +import org.opencypher.v9_0.util.Cost +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.{PatternExpression, SemanticDirection, Variable} import org.neo4j.cypher.internal.v3_5.logical.plans.{AllNodesScan, LogicalPlan, RightOuterHashJoin} class RightOuterHashJoinTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/SelectCoveredTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/SelectCoveredTest.scala index d89b2750cc9fc..e34562878af4a 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/SelectCoveredTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/SelectCoveredTest.scala @@ -19,12 +19,12 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner._ -import org.neo4j.cypher.internal.frontend.v3_5.ast._ +import org.opencypher.v9_0.ast._ import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.v3_5.logical.plans.Selection -import org.neo4j.cypher.internal.v3_5.expressions.{Equals, Expression, PatternExpression, SignedDecimalIntegerLiteral} +import org.opencypher.v9_0.expressions.{Equals, Expression, PatternExpression, SignedDecimalIntegerLiteral} class SelectCoveredTest extends CypherFunSuite with LogicalPlanningTestSupport with AstConstructionTestSupport { private implicit val planContext = newMockedPlanContext diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/SelectHasLabelWithJoinTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/SelectHasLabelWithJoinTest.scala index b81a79b3fa282..3ee8f57fabe05 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/SelectHasLabelWithJoinTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/SelectHasLabelWithJoinTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 import org.neo4j.cypher.internal.v3_5.logical.plans.{NodeByLabelScan, NodeHashJoin, Selection} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class SelectHasLabelWithJoinTest extends CypherFunSuite with LogicalPlanningTestSupport2 { test("should solve labels with joins") { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/SelectPatternPredicatesTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/SelectPatternPredicatesTest.scala index 9cb11c3c33085..bef5ebf7b51e5 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/SelectPatternPredicatesTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/SelectPatternPredicatesTest.scala @@ -23,11 +23,11 @@ import org.mockito.ArgumentMatchers._ import org.mockito.Mockito._ import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics.QueryGraphSolverInput -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5._ -import org.neo4j.cypher.internal.util.v3_5.Cardinality -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.Cardinality +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans._ class SelectPatternPredicatesTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/SortSkipAndLimitTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/SortSkipAndLimitTest.scala index 381a6f85acaf1..25eb3c85b0a08 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/SortSkipAndLimitTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/SortSkipAndLimitTest.scala @@ -21,12 +21,12 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps import org.neo4j.cypher.internal.compiler.v3_5.planner._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.LogicalPlanningContext -import org.neo4j.cypher.internal.frontend.v3_5.ast -import org.neo4j.cypher.internal.frontend.v3_5.ast.{AscSortItem, SortItem} +import org.opencypher.v9_0.ast +import org.opencypher.v9_0.ast.{AscSortItem, SortItem} import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans._ class SortSkipAndLimitTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/TriadicSelectionFinderTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/TriadicSelectionFinderTest.scala index 0b2d143314428..b031eacb5359d 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/TriadicSelectionFinderTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/TriadicSelectionFinderTest.scala @@ -23,9 +23,9 @@ import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSuppor import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{LogicalPlanningContext, QueryGraphProducer} import org.neo4j.cypher.internal.ir.v3_5.QueryGraph import org.neo4j.cypher.internal.planner.v3_5.spi.PlanContext -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection.{INCOMING, OUTGOING} -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection.{INCOMING, OUTGOING} +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans._ class TriadicSelectionFinderTest extends CypherFunSuite with LogicalPlanningTestSupport with QueryGraphProducer { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/countStorePlannerTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/countStorePlannerTest.scala index a96de027743f5..fe509067cd091 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/countStorePlannerTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/countStorePlannerTest.scala @@ -19,14 +19,14 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{LogicalPlanningContext, QueryGraphProducer} -import org.neo4j.cypher.internal.frontend.v3_5.ast.AstConstructionTestSupport +import org.opencypher.v9_0.ast.AstConstructionTestSupport import org.neo4j.cypher.internal.ir.v3_5.PlannerQuery import org.neo4j.cypher.internal.ir.v3_5.AggregatingQueryProjection import org.neo4j.cypher.internal.planner.v3_5.spi.PlanContext -import org.neo4j.cypher.internal.v3_5.expressions.{FunctionInvocation, FunctionName, Variable} +import org.opencypher.v9_0.expressions.{FunctionInvocation, FunctionName, Variable} import org.neo4j.cypher.internal.v3_5.logical.plans.{LogicalPlan, NodeCountFromCountStore, RelationshipCountFromCountStore} import org.scalatest.matchers.{MatchResult, Matcher} diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/getDegreeRewriterTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/getDegreeRewriterTest.scala index 516f5fe3b9a2f..e37982ec30c32 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/getDegreeRewriterTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/steps/getDegreeRewriterTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical.steps -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ast.AstConstructionTestSupport -import org.neo4j.cypher.internal.v3_5.expressions._ -import org.neo4j.cypher.internal.v3_5.functions.Exists +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.AstConstructionTestSupport +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.expressions.functions.Exists class getDegreeRewriterTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/unnestEagerTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/unnestEagerTest.scala index 1b4c1d3f268c1..f51524ac5ba20 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/unnestEagerTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/planner/logical/unnestEagerTest.scala @@ -22,10 +22,10 @@ package org.neo4j.cypher.internal.compiler.v3_5.planner.logical import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Eagerness.unnestEager import org.neo4j.cypher.internal.v3_5.logical.plans._ -import org.neo4j.cypher.internal.frontend.v3_5.helpers.fixedPoint -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.util.v3_5.attribution.Attributes -import org.neo4j.cypher.internal.v3_5.expressions.{PropertyKeyName, RelTypeName} +import org.opencypher.v9_0.util.helpers.fixedPoint +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.attribution.Attributes +import org.opencypher.v9_0.expressions.{PropertyKeyName, RelTypeName} class unnestEagerTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/prettifier/PrettifierParserTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/prettifier/PrettifierParserTest.scala index 9371d69885b51..531c9fffe006b 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/prettifier/PrettifierParserTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/prettifier/PrettifierParserTest.scala @@ -19,7 +19,8 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.prettifier -import org.neo4j.cypher.internal.frontend.v3_5.parser.ParserTest +import org.opencypher.v9_0.parser.ParserTest + class PrettifierParserTest extends ParserTest[Seq[SyntaxToken], Seq[SyntaxToken]] { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/prettifier/PrettifierTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/prettifier/PrettifierTest.scala index f7688baec7aeb..0cd49b7feed9e 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/prettifier/PrettifierTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/prettifier/PrettifierTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.compiler.v3_5.prettifier -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class PrettifierTest extends CypherFunSuite { diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/spi/GraphStatisticsSnapshotTest.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/spi/GraphStatisticsSnapshotTest.scala index b814c9460e257..22c31612b4853 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/spi/GraphStatisticsSnapshotTest.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/spi/GraphStatisticsSnapshotTest.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.compiler.v3_5.spi import org.neo4j.cypher.internal.planner.v3_5.spi._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.util.v3_5._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util._ import scala.language.reflectiveCalls diff --git a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/test_helpers/ContextHelper.scala b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/test_helpers/ContextHelper.scala index bcdb164a608f9..da0b888658921 100644 --- a/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/test_helpers/ContextHelper.scala +++ b/community/cypher/cypher-planner-3.5/src/test/scala/org/neo4j/cypher/internal/compiler/v3_5/test_helpers/ContextHelper.scala @@ -21,14 +21,15 @@ package org.neo4j.cypher.internal.compiler.v3_5.test_helpers import java.time.Clock -import org.neo4j.cypher.internal.util.v3_5.{CypherException, InputPosition, InternalException} import org.neo4j.cypher.internal.compiler.v3_5._ import org.neo4j.cypher.internal.compiler.v3_5.phases.CompilerContext import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{Metrics, QueryGraphSolver} -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.NO_TRACING -import org.neo4j.cypher.internal.frontend.v3_5.phases.{CompilationPhaseTracer, InternalNotificationLogger, Monitors, devNullLogger} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanContext -import org.neo4j.cypher.internal.util.v3_5.attribution.{IdGen, SequentialIdGen} +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.NO_TRACING +import org.opencypher.v9_0.frontend.phases.{InternalNotificationLogger, Monitors, devNullLogger} +import org.opencypher.v9_0.util.attribution.{IdGen, SequentialIdGen} +import org.opencypher.v9_0.util.{CypherException, InputPosition, InternalException} import org.scalatest.mock.MockitoSugar object ContextHelper extends MockitoSugar { diff --git a/community/cypher/cypher/LICENSES.txt b/community/cypher/cypher/LICENSES.txt index 7e5d556e6a28f..552e3afeedbe7 100644 --- a/community/cypher/cypher/LICENSES.txt +++ b/community/cypher/cypher/LICENSES.txt @@ -15,6 +15,12 @@ Apache Software License, Version 2.0 Lucene QueryParsers Netty/All-in-One opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala ------------------------------------------------------------------------------ diff --git a/community/cypher/cypher/NOTICE.txt b/community/cypher/cypher/NOTICE.txt index ec27c2cb0b706..319d5e752c57d 100644 --- a/community/cypher/cypher/NOTICE.txt +++ b/community/cypher/cypher/NOTICE.txt @@ -38,6 +38,12 @@ Apache Software License, Version 2.0 Lucene QueryParsers Netty/All-in-One opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala diff --git a/community/cypher/cypher/pom.xml b/community/cypher/cypher/pom.xml index b34eb750d5235..8188b2e408d3f 100644 --- a/community/cypher/cypher/pom.xml +++ b/community/cypher/cypher/pom.xml @@ -275,9 +275,9 @@ - org.neo4j - neo4j-cypher-util-3.5 - ${project.version} + org.opencypher + util-9.0 + ${openCypher.version} @@ -316,7 +316,7 @@ org.neo4j - openCypher-frontend-1 + neo4j-cypher-runtime-util ${project.version} test-jar test @@ -324,28 +324,35 @@ org.neo4j - neo4j-cypher-util-3.5 + neo4j-cypher-interpreted-runtime ${project.version} test-jar test - org.neo4j - neo4j-cypher-runtime-util - ${project.version} + org.opencypher + util-9.0 + ${openCypher.version} test-jar test - org.neo4j - neo4j-cypher-interpreted-runtime - ${project.version} + org.opencypher + ast-9.0 + ${openCypher.version} test-jar test + + org.opencypher + parser-9.0 + ${openCypher.version} + test-jar + test + diff --git a/community/cypher/cypher/src/main/java/org/neo4j/cypher/internal/codegen/CompiledConversionUtils.java b/community/cypher/cypher/src/main/java/org/neo4j/cypher/internal/codegen/CompiledConversionUtils.java index 7720ec74645f8..747f00413f27a 100644 --- a/community/cypher/cypher/src/main/java/org/neo4j/cypher/internal/codegen/CompiledConversionUtils.java +++ b/community/cypher/cypher/src/main/java/org/neo4j/cypher/internal/codegen/CompiledConversionUtils.java @@ -36,8 +36,8 @@ import java.util.stream.LongStream; import java.util.stream.Stream; -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException; -import org.neo4j.cypher.internal.util.v3_5.IncomparableValuesException; +import org.opencypher.v9_0.util.CypherTypeException; +import org.opencypher.v9_0.util.IncomparableValuesException; import org.neo4j.graphdb.Node; import org.neo4j.graphdb.PropertyContainer; import org.neo4j.graphdb.Relationship; diff --git a/community/cypher/cypher/src/main/java/org/neo4j/cypher/internal/codegen/CompiledMathHelper.java b/community/cypher/cypher/src/main/java/org/neo4j/cypher/internal/codegen/CompiledMathHelper.java index dfd1b8ffccb5a..eda8439b9cf89 100644 --- a/community/cypher/cypher/src/main/java/org/neo4j/cypher/internal/codegen/CompiledMathHelper.java +++ b/community/cypher/cypher/src/main/java/org/neo4j/cypher/internal/codegen/CompiledMathHelper.java @@ -23,8 +23,8 @@ import java.util.ArrayList; import java.util.List; -import org.neo4j.cypher.internal.util.v3_5.ArithmeticException; -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException; +import org.opencypher.v9_0.util.ArithmeticException; +import org.opencypher.v9_0.util.CypherTypeException; import org.neo4j.kernel.impl.util.ValueUtils; import org.neo4j.values.AnyValue; import org.neo4j.values.storable.ArrayValue; diff --git a/community/cypher/cypher/src/main/java/org/neo4j/cypher/internal/tracing/CompilationTracer.java b/community/cypher/cypher/src/main/java/org/neo4j/cypher/internal/tracing/CompilationTracer.java index 32a8bbea638ca..44248747f0c37 100644 --- a/community/cypher/cypher/src/main/java/org/neo4j/cypher/internal/tracing/CompilationTracer.java +++ b/community/cypher/cypher/src/main/java/org/neo4j/cypher/internal/tracing/CompilationTracer.java @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.tracing; -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer; +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer; public interface CompilationTracer { diff --git a/community/cypher/cypher/src/main/java/org/neo4j/cypher/internal/tracing/TimingCompilationTracer.java b/community/cypher/cypher/src/main/java/org/neo4j/cypher/internal/tracing/TimingCompilationTracer.java index 3a3a9e45255ce..32e6cd046e04a 100644 --- a/community/cypher/cypher/src/main/java/org/neo4j/cypher/internal/tracing/TimingCompilationTracer.java +++ b/community/cypher/cypher/src/main/java/org/neo4j/cypher/internal/tracing/TimingCompilationTracer.java @@ -23,7 +23,7 @@ import java.util.Collections; import java.util.List; -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer; +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer; public class TimingCompilationTracer implements CompilationTracer { diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/CompatibilityCache.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/CompatibilityCache.scala index 36079a95d5fd4..32c95ae56b766 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/CompatibilityCache.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/CompatibilityCache.scala @@ -29,7 +29,7 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{CommunityRuntimeBui import org.neo4j.cypher.internal.compatibility.{v2_3, v3_1, v3_3 => v3_3compat} import org.neo4j.cypher.internal.compiler.v3_5.CypherCompilerConfiguration import org.neo4j.cypher.internal.runtime.interpreted.LastCommittedTxIdProvider -import org.neo4j.cypher.internal.util.v3_5.InvalidArgumentException +import org.opencypher.v9_0.util.InvalidArgumentException import org.neo4j.cypher.{CypherPlanner, CypherRuntime, CypherUpdateStrategy} import org.neo4j.helpers.Clock import org.neo4j.kernel.GraphDatabaseQueryService diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/CompilerEngineDelegator.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/CompilerEngineDelegator.scala index 7d392a85e58ef..7267829c6ad14 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/CompilerEngineDelegator.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/CompilerEngineDelegator.scala @@ -22,9 +22,9 @@ package org.neo4j.cypher.internal import java.time.Clock import org.neo4j.cypher.internal.compiler.v3_5.{CypherCompilerConfiguration, StatsDivergenceCalculator} -import org.neo4j.cypher.internal.frontend.v3_5.helpers.fixedPoint -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer -import org.neo4j.cypher.internal.util.v3_5.InputPosition +import org.opencypher.v9_0.util.helpers.fixedPoint +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer +import org.opencypher.v9_0.util.InputPosition import org.neo4j.cypher.{InvalidArgumentException, SyntaxException, exceptionHandler, _} import org.neo4j.graphdb.factory.GraphDatabaseSettings import org.neo4j.graphdb.impl.notification.NotificationCode._ @@ -33,6 +33,7 @@ import org.neo4j.kernel.GraphDatabaseQueryService import org.neo4j.kernel.configuration.Config import org.neo4j.kernel.monitoring.{Monitors => KernelMonitors} import org.neo4j.logging.{Log, LogProvider} +import org.opencypher.v9_0.util object CompilerEngineDelegator { val DEFAULT_QUERY_CACHE_SIZE: Int = 128 @@ -85,7 +86,7 @@ class CompilerEngineDelegator(graph: GraphDatabaseQueryService, preParsedQuery = preParsedQuery.copy(version = CypherVersion.v3_1) } - def checkSupportedRuntime(ex: util.v3_5.SyntaxException): Unit = { + def checkSupportedRuntime(ex: util.SyntaxException): Unit = { if (!supportedRuntimes3_1.contains(preParsedQuery.runtime)) { if (config.useErrorsOverWarnings) { throw new InvalidArgumentException("The given query is not currently supported in the selected runtime") @@ -106,12 +107,12 @@ class CompilerEngineDelegator(graph: GraphDatabaseQueryService, parserQuery.onError { // if there is a create unique in the cypher 3.5 query try to fallback to 3.1 - case ex: util.v3_5.SyntaxException if ex.getMessage.startsWith("CREATE UNIQUE") => + case ex: util.SyntaxException if ex.getMessage.startsWith("CREATE UNIQUE") => preParsingNotifications = preParsingNotifications + createUniqueNotification(ex, preParsedQuery) checkSupportedRuntime(ex) Left(CypherVersion.v3_1) - case ex: util.v3_5.SyntaxException if ex.getMessage.startsWith("START is deprecated") => + case ex: util.SyntaxException if ex.getMessage.startsWith("START is deprecated") => preParsingNotifications = preParsingNotifications + createStartUnavailableNotification(ex, preParsedQuery) + createStartDeprecatedNotification(ex, preParsedQuery) @@ -143,23 +144,23 @@ class CompilerEngineDelegator(graph: GraphDatabaseQueryService, result.right.get } - private def createStartUnavailableNotification(ex: util.v3_5.SyntaxException, preParsedQuery: PreParsedQuery) = { + private def createStartUnavailableNotification(ex: util.SyntaxException, preParsedQuery: PreParsedQuery) = { val pos = convertInputPosition(ex.pos.getOrElse(preParsedQuery.offset)) START_UNAVAILABLE_FALLBACK.notification(pos) } - private def createStartDeprecatedNotification(ex: util.v3_5.SyntaxException, preParsedQuery: PreParsedQuery) = { + private def createStartDeprecatedNotification(ex: util.SyntaxException, preParsedQuery: PreParsedQuery) = { val pos = convertInputPosition(ex.pos.getOrElse(preParsedQuery.offset)) START_DEPRECATED.notification(pos, message("START", ex.getMessage)) } - private def runtimeUnsupportedNotification(ex: util.v3_5.SyntaxException, preParsedQuery: PreParsedQuery) = { + private def runtimeUnsupportedNotification(ex: util.SyntaxException, preParsedQuery: PreParsedQuery) = { val pos = convertInputPosition(ex.pos.getOrElse(preParsedQuery.offset)) RUNTIME_UNSUPPORTED.notification(pos) } - private def createUniqueNotification(ex: util.v3_5.SyntaxException, preParsedQuery: PreParsedQuery) = { + private def createUniqueNotification(ex: util.SyntaxException, preParsedQuery: PreParsedQuery) = { val pos = convertInputPosition(ex.pos.getOrElse(preParsedQuery.offset)) CREATE_UNIQUE_UNAVAILABLE_FALLBACK.notification(pos) } diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/CypherPreParser.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/CypherPreParser.scala index cfd26930d1593..3ea951a98a4bc 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/CypherPreParser.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/CypherPreParser.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal -import org.neo4j.cypher.internal.frontend.v3_5.parser.Base -import org.neo4j.cypher.internal.util.v3_5.InputPosition +import org.opencypher.v9_0.parser.Base +import org.opencypher.v9_0.util.InputPosition import org.parboiled.scala._ final case class PreParsedStatement(statement: String, options: Seq[PreParserOption], offset: InputPosition) diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/ExecutionEngine.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/ExecutionEngine.scala index 06070798ded26..3166143c0c51c 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/ExecutionEngine.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/ExecutionEngine.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal import java.time.Clock import org.neo4j.cypher.internal.compatibility.{CypherCacheMonitor, LFUCache} -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer import org.neo4j.cypher.internal.runtime.interpreted.{LastCommittedTxIdProvider, ValueConversion} import org.neo4j.cypher.internal.tracing.CompilationTracer import org.neo4j.cypher.internal.tracing.CompilationTracer.QueryCompilationEvent diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/ParsedQuery.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/ParsedQuery.scala index 776f95c754b97..154389f2f15af 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/ParsedQuery.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/ParsedQuery.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer import org.neo4j.kernel.impl.query.TransactionalContext import scala.util.Try diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/PreParsedQuery.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/PreParsedQuery.scala index 52d380bab0dea..ce82dfaf23431 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/PreParsedQuery.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/PreParsedQuery.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal import org.neo4j.cypher._ -import org.neo4j.cypher.internal.util.v3_5.InputPosition +import org.opencypher.v9_0.util.InputPosition /** * Representation a pre-parsed Cypher query. diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/LatestRuntimeVariablePlannerCompatibility.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/LatestRuntimeVariablePlannerCompatibility.scala index 1f7b768c29790..c17e758867f4b 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/LatestRuntimeVariablePlannerCompatibility.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/LatestRuntimeVariablePlannerCompatibility.scala @@ -33,7 +33,7 @@ import org.neo4j.cypher.internal.compiler.v3_5._ import org.neo4j.cypher.internal.compiler.v3_5.phases.{CompilationContains, LogicalPlanState} import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.QueryGraphSolver import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.idp._ -import org.neo4j.cypher.internal.frontend.v3_5.phases._ +import org.opencypher.v9_0.frontend.phases._ import org.neo4j.cypher.internal.javacompat.ExecutionResult import org.neo4j.cypher.internal.planner.v3_5.spi.{CostBasedPlannerName, DPPlannerName, IDPPlannerName} import org.neo4j.cypher.internal.runtime.interpreted.TransactionBoundQueryContext.IndexSearchMonitor diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v2_3/Compatibility.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v2_3/Compatibility.scala index 063d990b86f03..42488159faa95 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v2_3/Compatibility.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v2_3/Compatibility.scala @@ -30,7 +30,7 @@ import org.neo4j.cypher.internal.compiler.v2_3.executionplan.{EntityAccessor, Ex import org.neo4j.cypher.internal.compiler.v2_3.spi.{PlanContext, QueryContext} import org.neo4j.cypher.internal.compiler.v2_3.tracing.rewriters.RewriterStepSequencer import org.neo4j.cypher.internal.compiler.v2_3.{InfoLogger, ExplainMode => ExplainModev2_3, NormalMode => NormalModev2_3, ProfileMode => ProfileModev2_3, _} -import org.neo4j.cypher.internal.frontend.v3_5 +import org.opencypher.v9_0.frontend.phases import org.neo4j.cypher.internal.javacompat.ExecutionResult import org.neo4j.cypher.internal.runtime.interpreted.{LastCommittedTxIdProvider, TransactionalContextWrapper} import org.neo4j.cypher.internal.spi.v2_3.{TransactionBoundGraphStatistics, TransactionBoundPlanContext, TransactionBoundQueryContext} @@ -77,7 +77,7 @@ trait Compatibility { Some(as2_3(preParsedQuery.offset)), tracer)) new ParsedQuery { def plan(transactionalContext: TransactionalContext, - tracer: v3_5.phases.CompilationPhaseTracer): (ExecutionPlan, Map[String, Any], Seq[String]) = exceptionHandler + tracer: phases.CompilationPhaseTracer): (ExecutionPlan, Map[String, Any], Seq[String]) = exceptionHandler .runSafely { val planContext: PlanContext = new TransactionBoundPlanContext(TransactionalContextWrapper(transactionalContext)) val (planImpl, extractedParameters) = compiler diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v2_3/ExecutionResultWrapper.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v2_3/ExecutionResultWrapper.scala index 6a23f86d87a8d..b5fae81a4d7c3 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v2_3/ExecutionResultWrapper.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v2_3/ExecutionResultWrapper.scala @@ -34,8 +34,8 @@ import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments._ import org.neo4j.cypher.internal.runtime.planDescription.{Children, NoChildren, PlanDescriptionImpl, SingleChild, TwoChildren, Argument => Argument3_4, InternalPlanDescription => InternalPlanDescription3_4} import org.neo4j.cypher.internal.runtime.{QueryStatistics, SCHEMA_WRITE, ExecutionMode => ExecutionModev3_5, _} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection.{BOTH, INCOMING, OUTGOING} +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.expressions.SemanticDirection.{BOTH, INCOMING, OUTGOING} import org.neo4j.cypher.result.QueryResult import org.neo4j.cypher.result.QueryResult.Record import org.neo4j.graphdb.Result.ResultVisitor diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v2_3/helpers.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v2_3/helpers.scala index 0798c8f29e882..69f9f0d01b210 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v2_3/helpers.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v2_3/helpers.scala @@ -20,14 +20,14 @@ package org.neo4j.cypher.internal.compatibility.v2_3 import org.neo4j.cypher.InternalException -import org.neo4j.cypher.internal.util.v3_5.InputPosition +import org.opencypher.v9_0.util.InputPosition import org.neo4j.cypher.internal.compiler.v2_3 import org.neo4j.cypher.internal.compiler.v2_3.CompilationPhaseTracer.CompilationPhaseEvent import org.neo4j.cypher.internal.compiler.v2_3.{CypherCompilerConfiguration => CypherCompilerConfiguration2_3} import org.neo4j.cypher.internal.compiler.v3_5.CypherCompilerConfiguration import org.neo4j.cypher.internal.frontend.v2_3.{InputPosition => InputPosition2_3} -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer -import org.neo4j.cypher.internal.frontend.v3_5.phases +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer +import org.opencypher.v9_0.frontend.phases import org.neo4j.kernel.impl.query.{QueryExecutionMonitor, TransactionalContext} object helpers { diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_1/Compatibility.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_1/Compatibility.scala index 06773dbb14895..d96e8a8f4a782 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_1/Compatibility.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_1/Compatibility.scala @@ -42,6 +42,7 @@ import org.neo4j.kernel.monitoring.{Monitors => KernelMonitors} import org.neo4j.logging.Log import org.neo4j.values.AnyValue import org.neo4j.values.virtual.MapValue +import org.opencypher.v9_0.{frontend => v3_5} import scala.collection.mutable import scala.util.Try @@ -74,7 +75,7 @@ trait Compatibility { Some(helpers.as3_1(preParsedQuery.offset)), tracer)) new ParsedQuery { override def plan(transactionalContext: TransactionalContext, - tracer: frontend.v3_5.phases.CompilationPhaseTracer): + tracer: v3_5.phases.CompilationPhaseTracer): (ExecutionPlan, Map[String, Any], Seq[String]) = exceptionHandler.runSafely { val tc = TransactionalContextWrapperV3_1(transactionalContext) diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_1/ExecutionResultWrapper.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_1/ExecutionResultWrapper.scala index 139952f37a8c3..956ba0b1aa9b2 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_1/ExecutionResultWrapper.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_1/ExecutionResultWrapper.scala @@ -36,9 +36,9 @@ import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments._ import org.neo4j.cypher.internal.runtime.planDescription.{Argument, Children, NoChildren, PlanDescriptionImpl, SingleChild, TwoChildren, InternalPlanDescription => InternalPlanDescription3_4} import org.neo4j.cypher.internal.runtime.{ExplainMode, NormalMode, ProfileMode, QueryStatistics} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.{symbols => symbolsv3_5} -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection.{BOTH, INCOMING, OUTGOING} +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.{symbols => symbolsv3_5} +import org.opencypher.v9_0.expressions.SemanticDirection.{BOTH, INCOMING, OUTGOING} import org.neo4j.cypher.internal.v3_5.logical.plans.QualifiedName import org.neo4j.cypher.result.QueryResult import org.neo4j.cypher.result.QueryResult.Record diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_1/helpers.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_1/helpers.scala index 992967484f340..75801ec8a8e54 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_1/helpers.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_1/helpers.scala @@ -20,14 +20,14 @@ package org.neo4j.cypher.internal.compatibility.v3_1 import org.neo4j.cypher.InternalException -import org.neo4j.cypher.internal.util.v3_5.InputPosition +import org.opencypher.v9_0.util.InputPosition import org.neo4j.cypher.internal.compiler.v3_1 import org.neo4j.cypher.internal.compiler.v3_1.CompilationPhaseTracer.{CompilationPhaseEvent, CompilationPhase => v3_1Phase} import org.neo4j.cypher.internal.compiler.v3_1.{CypherCompilerConfiguration => CypherCompilerConfiguration3_1} -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.{CompilationPhase => v3_5Phase} +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.{CompilationPhase => v3_5Phase} import org.neo4j.cypher.internal.compiler.v3_5.CypherCompilerConfiguration import org.neo4j.cypher.internal.frontend.v3_1.{InputPosition => InputPosition3_1} -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer import org.neo4j.kernel.impl.query.{QueryExecutionMonitor, TransactionalContext} object helpers { diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/ActiveReadInjector.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/ActiveReadInjector.scala index 5c11f8e38f9f5..23660dfee0663 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/ActiveReadInjector.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/ActiveReadInjector.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.compatibility.v3_3 -import org.neo4j.cypher.internal.util.v3_5.attribution.{Attributes, SameId} -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} +import org.opencypher.v9_0.util.attribution.{Attributes, SameId} +import org.opencypher.v9_0.util.{Rewriter, bottomUp} import org.neo4j.cypher.internal.v3_5.logical.plans._ /** diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/Compatibility.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/Compatibility.scala index bd69504e625e9..5245b736649d1 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/Compatibility.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/Compatibility.scala @@ -41,11 +41,11 @@ import org.neo4j.cypher.internal.frontend.v3_3.ast.{Expression, Parameter, State import org.neo4j.cypher.internal.frontend.v3_3.helpers.rewriting.RewriterStepSequencer import org.neo4j.cypher.internal.frontend.v3_3.phases import org.neo4j.cypher.internal.frontend.v3_3.phases.{Monitors => MonitorsV3_3, RecordingNotificationLogger => RecordingNotificationLoggerV3_3} -import org.neo4j.cypher.internal.frontend.v3_5.phases.{CompilationPhaseTracer, Transformer, RecordingNotificationLogger => RecordingNotificationLoggerv3_5} +import org.opencypher.v9_0.frontend.phases.{CompilationPhaseTracer, Transformer, RecordingNotificationLogger => RecordingNotificationLoggerv3_5} import org.neo4j.cypher.internal.planner.v3_5.spi.{CostBasedPlannerName, PlanContext, InstrumentedGraphStatistics => InstrumentedGraphStatisticsv3_5, MutableGraphStatisticsSnapshot => MutableGraphStatisticsSnapshotv3_5} import org.neo4j.cypher.internal.runtime.interpreted._ import org.neo4j.cypher.internal.spi.v3_3.{ExceptionTranslatingPlanContext => ExceptionTranslatingPlanContextV3_3, TransactionBoundGraphStatistics => TransactionBoundGraphStatisticsV3_3, TransactionBoundPlanContext => TransactionBoundPlanContextV3_3} -import org.neo4j.cypher.internal.util.v3_5.attribution.SequentialIdGen +import org.opencypher.v9_0.util.attribution.SequentialIdGen import org.neo4j.cypher.{CypherPlanner, CypherRuntime, CypherUpdateStrategy} import org.neo4j.kernel.impl.query.TransactionalContext import org.neo4j.kernel.monitoring.{Monitors => KernelMonitors} diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/IdConverter.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/IdConverter.scala index fc558a50f0e8b..a8f65938526c3 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/IdConverter.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/IdConverter.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.compatibility.v3_3 -import org.neo4j.cypher.internal.util.v3_5.attribution._ +import org.opencypher.v9_0.util.attribution._ import org.neo4j.cypher.internal.v3_3.logical.plans.{LogicalPlan => LogicalPlanV3_3} trait IdConverter { diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/LogicalPlanConverter.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/LogicalPlanConverter.scala index b017951681718..bb60b8b33ac4c 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/LogicalPlanConverter.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/LogicalPlanConverter.scala @@ -28,17 +28,17 @@ import org.neo4j.cypher.internal.frontend.v3_3.{InputPosition => InputPositionV3 import org.neo4j.cypher.internal.frontend.{v3_3 => frontendV3_3} import org.neo4j.cypher.internal.ir.{v3_3 => irV3_3, v3_5 => irv3_5} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.Rewritable.RewritableAny -import org.neo4j.cypher.internal.util.v3_5.attribution.{IdGen, SequentialIdGen} -import org.neo4j.cypher.internal.util.v3_5.symbols.CypherType -import org.neo4j.cypher.internal.util.v3_5.{symbols => symbolsv3_5, _} -import org.neo4j.cypher.internal.util.{v3_5 => utilv3_5} +import org.opencypher.v9_0.util.Rewritable.RewritableAny +import org.opencypher.v9_0.util.attribution.{IdGen, SequentialIdGen} +import org.opencypher.v9_0.util.symbols.CypherType +import org.opencypher.v9_0.util.{symbols => symbolsv3_5, _} +import org.opencypher.v9_0.{util => utilv3_5} import org.neo4j.cypher.internal.v3_3.logical.plans.{LogicalPlan => LogicalPlanV3_3} import org.neo4j.cypher.internal.v3_3.logical.{plans => plansV3_3} -import org.neo4j.cypher.internal.v3_5.expressions.{Expression => Expressionv3_5} +import org.opencypher.v9_0.expressions.{Expression => Expressionv3_5} import org.neo4j.cypher.internal.v3_5.logical.plans.{FieldSignature, ProcedureAccessMode, QualifiedName, LogicalPlan => LogicalPlanv3_5} import org.neo4j.cypher.internal.v3_5.logical.{plans => plansv3_5} -import org.neo4j.cypher.internal.v3_5.{expressions => expressionsv3_5} +import org.opencypher.v9_0.{expressions => expressionsv3_5} import scala.collection.mutable import scala.collection.mutable.{HashMap => MutableHashMap} diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/SemanticTableConverter.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/SemanticTableConverter.scala index 254b601f3ecc8..e91c251f5ef04 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/SemanticTableConverter.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/SemanticTableConverter.scala @@ -21,13 +21,13 @@ package org.neo4j.cypher.internal.compatibility.v3_3 import org.neo4j.cypher.internal.frontend.v3_3.{SemanticTable => SemanticTableV3_3, ast => astV3_3} import org.neo4j.cypher.internal.frontend.v3_3.{InputPosition => InputPositionV3_3} -import org.neo4j.cypher.internal.frontend.v3_5.{ast => astv3_5} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{ExpressionTypeInfo, SemanticTable => SemanticTablev3_5} -import org.neo4j.cypher.internal.frontend.{v3_3 => frontendV3_3, v3_5 => frontendv3_5} -import org.neo4j.cypher.internal.v3_5.{expressions => expressionsv3_5} -import org.neo4j.cypher.internal.util.{v3_5 => utilv3_5} +import org.opencypher.v9_0.{ast => astv3_5} +import org.opencypher.v9_0.ast.semantics.{ExpressionTypeInfo, SemanticTable => SemanticTablev3_5} +import org.neo4j.cypher.internal.frontend.{v3_3 => frontendV3_3} +import org.opencypher.v9_0.{expressions => expressionsv3_5} +import org.opencypher.v9_0.{util => utilv3_5} import org.neo4j.cypher.internal.frontend.v3_3.ast.{Expression => ExpressionV3_3} -import org.neo4j.cypher.internal.v3_5.expressions.{Expression => Expressionv3_5} +import org.opencypher.v9_0.expressions.{Expression => Expressionv3_5} import scala.collection.mutable @@ -47,7 +47,7 @@ object SemanticTableConverter { } private def convert(types: astV3_3.ASTAnnotationMap[astV3_3.Expression, frontendV3_3.ExpressionTypeInfo], expressionMapping: ExpressionMapping3To4): - astv3_5.ASTAnnotationMap[expressionsv3_5.Expression, frontendv3_5.semantics.ExpressionTypeInfo] = { + astv3_5.ASTAnnotationMap[expressionsv3_5.Expression, astv3_5.semantics.ExpressionTypeInfo] = { val result: Map[Expressionv3_5, ExpressionTypeInfo] = types.filter { case (exprV3_3, _) => expressionMapping.isDefinedAt((exprV3_3, exprV3_3.position)) }.map { @@ -64,9 +64,9 @@ object SemanticTableConverter { res } - private def convert(typeInfoV3_3: frontendV3_3.ExpressionTypeInfo): frontendv3_5.semantics.ExpressionTypeInfo = typeInfoV3_3 match { + private def convert(typeInfoV3_3: frontendV3_3.ExpressionTypeInfo): astv3_5.semantics.ExpressionTypeInfo = typeInfoV3_3 match { case frontendV3_3.ExpressionTypeInfo(specified, expected) => - frontendv3_5.semantics.ExpressionTypeInfo(convert(specified), expected.map(convert)) + astv3_5.semantics.ExpressionTypeInfo(convert(specified), expected.map(convert)) } private def convert(specified: frontendV3_3.symbols.TypeSpec): utilv3_5.symbols.TypeSpec = { diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/StatementWrapper.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/StatementWrapper.scala index 8185c2324c3e6..913880834455d 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/StatementWrapper.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/StatementWrapper.scala @@ -21,8 +21,10 @@ package org.neo4j.cypher.internal.compatibility.v3_3 import org.neo4j.cypher.internal.compatibility.v3_3.helpers.as3_4 import org.neo4j.cypher.internal.frontend.v3_3.{ast => astV3_3} -import org.neo4j.cypher.internal.frontend.v3_5.{SemanticCheck, ast => astv3_5} -import org.neo4j.cypher.internal.util.v3_5.InputPosition +import org.opencypher.v9_0.ast.semantics.SemanticCheck +import org.opencypher.v9_0.{ast => astv3_5} + +import org.opencypher.v9_0.util.InputPosition case class StatementWrapper(statement: astV3_3.Statement) extends astv3_5.Statement { override def semanticCheck: SemanticCheck = ??? diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/WrappedInstrumentedGraphStatistics.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/WrappedInstrumentedGraphStatistics.scala index d6aa46b810c0d..ef9302460f649 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/WrappedInstrumentedGraphStatistics.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/WrappedInstrumentedGraphStatistics.scala @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.compiler.v3_3.spi.{GraphStatistics => GraphStat import org.neo4j.cypher.internal.frontend.v3_3.{LabelId => LabelIdV3_3, PropertyKeyId => PropertyKeyIdV3_3, RelTypeId => RelTypeIdV3_3} import org.neo4j.cypher.internal.ir.v3_3.{Cardinality => CardinalityV3_3, Selectivity => SelectivityV3_3} import org.neo4j.cypher.internal.planner.v3_5.spi._ -import org.neo4j.cypher.internal.util.v3_5.{LabelId, PropertyKeyId, RelTypeId} +import org.opencypher.v9_0.util.{LabelId, PropertyKeyId, RelTypeId} /** * This class will act as a v3.3 InstrumentedGraphStatistics, but will update instead a map of values diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/exceptionHandler.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/exceptionHandler.scala index 3f792b1579169..3e6e84df52400 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/exceptionHandler.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/exceptionHandler.scala @@ -24,7 +24,7 @@ import org.neo4j.cypher.exceptionHandler.{RunSafely, mapToCypher} import org.neo4j.cypher.internal.compatibility.{ExceptionHandler, _} import org.neo4j.cypher.internal.frontend.v3_3.spi.MapToPublicExceptions import org.neo4j.cypher.internal.frontend.v3_3.{CypherException => InternalCypherExceptionV3_3} -import org.neo4j.cypher.internal.util.v3_5.{CypherException => InternalCypherExceptionv3_5} +import org.opencypher.v9_0.util.{CypherException => InternalCypherExceptionv3_5} import org.neo4j.cypher.{exceptionHandler => exceptionHandlerv3_5} import org.neo4j.values.utils.ValuesException diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/helpers.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/helpers.scala index dfe09d2ae4adf..a90e7244eefba 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/helpers.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_3/helpers.scala @@ -23,27 +23,27 @@ import org.neo4j.cypher.CypherVersion.v3_3 import org.neo4j.cypher.InternalException import org.neo4j.cypher.internal.compiler.v3_3.phases.{LogicalPlanState => LogicalPlanStateV3_3} import org.neo4j.cypher.internal.compiler.v3_3.{CypherCompilerConfiguration => CypherCompilerConfiguration3_3, DPPlannerName => DPPlannerNameV3_3, IDPPlannerName => IDPPlannerNameV3_3, ProcedurePlannerName => ProcedurePlannerNameV3_3, UpdateStrategy => UpdateStrategyV3_3} -import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} import org.neo4j.cypher.internal.compiler.v3_5.phases.LogicalPlanState import org.neo4j.cypher.internal.compiler.v3_5.{CypherCompilerConfiguration, UpdateStrategy, defaultUpdateStrategy, eagerUpdateStrategy} import org.neo4j.cypher.internal.compiler.{v3_5 => compilerv3_5} import org.neo4j.cypher.internal.frontend.v3_3.ast.{Expression => ExpressionV3_3} import org.neo4j.cypher.internal.frontend.v3_3.phases.CompilationPhaseTracer.{CompilationPhase => v3_3Phase} import org.neo4j.cypher.internal.frontend.v3_3.phases.{CompilationPhaseTracer => CompilationPhaseTracer3_3} -import org.neo4j.cypher.internal.frontend.v3_3.{phases => phasesV3_3} -import org.neo4j.cypher.internal.frontend.v3_3.{InputPosition => InputPositionV3_3, PlannerName => PlannerNameV3_3, ast => astV3_3, notification => nfV3_3} -import org.neo4j.cypher.internal.frontend.v3_5.{PlannerName, ast => astv3_5, notification => nfv3_5} -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.{CompilationPhase => v3_5Phase} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticTable => SemanticTablev3_5} +import org.neo4j.cypher.internal.frontend.v3_3.{InputPosition => InputPositionV3_3, PlannerName => PlannerNameV3_3, ast => astV3_3, notification => nfV3_3, phases => phasesV3_3} import org.neo4j.cypher.internal.ir.v3_3.{Cardinality => CardinalityV3_3} import org.neo4j.cypher.internal.ir.{v3_3 => irV3_3, v3_5 => irv3_5} +import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} import org.neo4j.cypher.internal.planner.v3_5.spi.{DPPlannerName, IDPPlannerName, PlannerNameWithVersion, ProcedurePlannerName} -import org.neo4j.cypher.internal.util.v3_5.attribution.{Attributes, Id} -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, InputPosition} import org.neo4j.cypher.internal.v3_3.logical.plans.{LogicalPlanId => LogicalPlanIdV3_3} import org.neo4j.cypher.internal.v3_5.logical.plans.{LogicalPlan => LogicalPlanv3_5} import org.neo4j.kernel.impl.query.{QueryExecutionMonitor, TransactionalContext} +import org.opencypher.v9_0.ast.semantics.{SemanticTable => SemanticTablev3_5} +import org.opencypher.v9_0.frontend.PlannerName +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.{CompilationPhase => v3_5Phase} +import org.opencypher.v9_0.util.attribution.{Attributes, Id} +import org.opencypher.v9_0.util.{Cardinality, InputPosition} +import org.opencypher.v9_0.{ast => astv3_5, util => nfv3_5} object helpers { implicit def monitorFailure(t: Throwable)(implicit monitor: QueryExecutionMonitor, tc: TransactionalContext): Unit = { diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/CheckForLoadCsvAndMatchOnLargeLabel.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/CheckForLoadCsvAndMatchOnLargeLabel.scala index cf3de62380267..eaf77bd245f12 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/CheckForLoadCsvAndMatchOnLargeLabel.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/CheckForLoadCsvAndMatchOnLargeLabel.scala @@ -19,10 +19,9 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5 -import org.neo4j.cypher.internal.frontend.v3_5.notification.{InternalNotification, LargeLabelWithLoadCsvNotification} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanContext -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, LabelId, NameId} import org.neo4j.cypher.internal.v3_5.logical.plans.{LoadCSV, LogicalPlan, NodeByLabelScan} +import org.opencypher.v9_0.util._ case class CheckForLoadCsvAndMatchOnLargeLabel(planContext: PlanContext, nonIndexedLabelWarningThreshold: Long @@ -31,7 +30,7 @@ case class CheckForLoadCsvAndMatchOnLargeLabel(planContext: PlanContext, private val threshold = Cardinality(nonIndexedLabelWarningThreshold) def apply(plan: LogicalPlan): Option[InternalNotification] = { - import org.neo4j.cypher.internal.util.v3_5.Foldable._ + import org.opencypher.v9_0.util.Foldable._ sealed trait SearchState case object NoneFound extends SearchState diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/Compatibility.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/Compatibility.scala index 6e7b624e5f222..02d48bcfa91dc 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/Compatibility.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/Compatibility.scala @@ -33,16 +33,16 @@ import org.neo4j.cypher.internal.compiler.v3_5 import org.neo4j.cypher.internal.compiler.v3_5._ import org.neo4j.cypher.internal.compiler.v3_5.phases.LogicalPlanState import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{CachedMetricsFactory, SimpleMetricsFactory} -import org.neo4j.cypher.internal.frontend.v3_5.ast.Statement -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.RewriterStepSequencer -import org.neo4j.cypher.internal.frontend.v3_5.phases._ +import org.opencypher.v9_0.ast.Statement +import org.opencypher.v9_0.frontend.phases._ import org.neo4j.cypher.internal.planner.v3_5.spi.{CostBasedPlannerName, DPPlannerName, IDPPlannerName, PlanContext} import org.neo4j.cypher.internal.runtime.interpreted._ -import org.neo4j.cypher.internal.util.v3_5.attribution.SequentialIdGen -import org.neo4j.cypher.internal.v3_5.expressions.Parameter +import org.opencypher.v9_0.util.attribution.SequentialIdGen +import org.opencypher.v9_0.expressions.Parameter import org.neo4j.kernel.impl.query.TransactionalContext import org.neo4j.kernel.monitoring.{Monitors => KernelMonitors} import org.neo4j.logging.Log +import org.opencypher.v9_0.rewriting.RewriterStepSequencer import scala.util.Try diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/ExceptionTranslatingPlanContext.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/ExceptionTranslatingPlanContext.scala index 5071bf5688daa..f3dae765634cc 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/ExceptionTranslatingPlanContext.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/ExceptionTranslatingPlanContext.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5 -import org.neo4j.cypher.internal.frontend.v3_5.phases.InternalNotificationLogger +import org.opencypher.v9_0.frontend.phases.InternalNotificationLogger import org.neo4j.cypher.internal.planner.v3_5.spi.{GraphStatistics, IndexDescriptor, PlanContext} import org.neo4j.cypher.internal.v3_5.logical.plans.{ProcedureSignature, QualifiedName, UserFunctionSignature} diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/ExceptionTranslatingQueryContext.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/ExceptionTranslatingQueryContext.scala index 19335b40761e3..6522ad467a546 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/ExceptionTranslatingQueryContext.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/ExceptionTranslatingQueryContext.scala @@ -25,7 +25,7 @@ import org.eclipse.collections.api.iterator.LongIterator import org.neo4j.cypher.internal.planner.v3_5.spi.IndexDescriptor import org.neo4j.cypher.internal.runtime._ import org.neo4j.cypher.internal.runtime.interpreted.{DelegatingOperations, DelegatingQueryTransactionalContext} -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.cypher.internal.v3_5.logical.plans.QualifiedName import org.neo4j.graphdb.{Node, Path, PropertyContainer} import org.neo4j.internal.kernel.api.{IndexQuery, IndexReference} diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/LogicalPlanNotifications.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/LogicalPlanNotifications.scala index 4b560fc8fc3a0..0d770f707b587 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/LogicalPlanNotifications.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/LogicalPlanNotifications.scala @@ -20,9 +20,9 @@ package org.neo4j.cypher.internal.compatibility.v3_5 import org.neo4j.cypher.internal.compiler.v3_5.CypherCompilerConfiguration -import org.neo4j.cypher.internal.frontend.v3_5.notification.InternalNotification import org.neo4j.cypher.internal.planner.v3_5.spi.PlanContext import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan +import org.opencypher.v9_0.util.InternalNotification object LogicalPlanNotifications { def checkForNotifications(logicalPlan: LogicalPlan, diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/WrappedMonitors.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/WrappedMonitors.scala index e0b9b57430713..23446123ff846 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/WrappedMonitors.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/WrappedMonitors.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5 -import org.neo4j.cypher.internal.frontend.v3_5.phases.Monitors +import org.opencypher.v9_0.frontend.phases.Monitors import org.neo4j.kernel.monitoring.{Monitors => KernelMonitors} import scala.reflect.ClassTag diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/checkForEagerLoadCsv.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/checkForEagerLoadCsv.scala index 38859cae3c806..8076cdd670fdd 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/checkForEagerLoadCsv.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/checkForEagerLoadCsv.scala @@ -19,13 +19,13 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5 -import org.neo4j.cypher.internal.frontend.v3_5.notification.{EagerLoadCsvNotification, InternalNotification} import org.neo4j.cypher.internal.v3_5.logical.plans.{Eager, LoadCSV, LogicalPlan} +import org.opencypher.v9_0.util.{EagerLoadCsvNotification, InternalNotification} object checkForEagerLoadCsv extends (LogicalPlan => Option[InternalNotification]) { def apply(plan: LogicalPlan) = { - import org.neo4j.cypher.internal.util.v3_5.Foldable._ + import org.opencypher.v9_0.util.Foldable._ sealed trait SearchState case object NoEagerFound extends SearchState case object EagerFound extends SearchState diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/BuildInterpretedExecutionPlan.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/BuildInterpretedExecutionPlan.scala index 018f65b97805e..1f5ea0c86c050 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/BuildInterpretedExecutionPlan.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/BuildInterpretedExecutionPlan.scala @@ -24,15 +24,15 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.executionplan._ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.phases.CompilationState import org.neo4j.cypher.internal.compatibility.v3_5.runtime.profiler.Profiler import org.neo4j.cypher.internal.compiler.v3_5.phases._ -import org.neo4j.cypher.internal.frontend.v3_5.PlannerName -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.PIPE_BUILDING -import org.neo4j.cypher.internal.frontend.v3_5.phases.{InternalNotificationLogger, Phase} +import org.opencypher.v9_0.frontend.PlannerName +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase.PIPE_BUILDING +import org.opencypher.v9_0.frontend.phases.{InternalNotificationLogger, Phase} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities import org.neo4j.cypher.internal.runtime.interpreted.UpdateCountingQueryContext import org.neo4j.cypher.internal.runtime.interpreted.commands.convert.{CommunityExpressionConverter, ExpressionConverters} import org.neo4j.cypher.internal.runtime.interpreted.pipes.PipeExecutionBuilderContext import org.neo4j.cypher.internal.runtime.{ExecutionMode, InternalExecutionResult, ProfileMode, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.PeriodicCommitInOpenTransactionException +import org.opencypher.v9_0.util.PeriodicCommitInOpenTransactionException import org.neo4j.cypher.internal.v3_5.logical.plans.{IndexUsage, LogicalPlan} import org.neo4j.values.virtual.MapValue diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/CommunityRuntimeContext.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/CommunityRuntimeContext.scala index 40bcc3f6cd0cc..95d39e9d7a9b3 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/CommunityRuntimeContext.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/CommunityRuntimeContext.scala @@ -21,13 +21,13 @@ package org.neo4j.cypher.internal.compatibility.v3_5.runtime import java.time.Clock -import org.neo4j.cypher.internal.util.v3_5.{CypherException, InputPosition} +import org.opencypher.v9_0.util.{CypherException, InputPosition} import org.neo4j.cypher.internal.compiler.v3_5.phases.CompilerContext import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{ExpressionEvaluator, Metrics, MetricsFactory, QueryGraphSolver} import org.neo4j.cypher.internal.compiler.v3_5.{ContextCreator, CypherCompilerConfiguration, SyntaxExceptionCreator, UpdateStrategy} -import org.neo4j.cypher.internal.frontend.v3_5.phases.{CompilationPhaseTracer, InternalNotificationLogger, Monitors} +import org.opencypher.v9_0.frontend.phases.{CompilationPhaseTracer, InternalNotificationLogger, Monitors} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanContext -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen +import org.opencypher.v9_0.util.attribution.IdGen class CommunityRuntimeContext(override val exceptionCreator: (String, InputPosition) => CypherException, override val tracer: CompilationPhaseTracer, diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/PipeExecutionResult.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/PipeExecutionResult.scala index 8a8afb89f5390..e29f58a8c5304 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/PipeExecutionResult.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/PipeExecutionResult.scala @@ -24,7 +24,7 @@ import java.util import org.neo4j.cypher.CypherVersion import org.neo4j.cypher.internal.compatibility.v3_5.runtime.helpers.MapBasedRow -import org.neo4j.cypher.internal.util.v3_5.Eagerly.immutableMapValues +import org.opencypher.v9_0.util.Eagerly.immutableMapValues import org.neo4j.cypher.internal.runtime._ import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ResultIterator.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ResultIterator.scala index 0022b0c3ea874..617ac7fd5cead 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ResultIterator.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ResultIterator.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5.runtime -import org.neo4j.cypher.internal.util.v3_5.{CypherException, TaskCloser} +import org.opencypher.v9_0.util.{CypherException, TaskCloser} import org.neo4j.cypher.result.QueryResult import org.neo4j.values.AnyValue diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/RuntimeBuilder.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/RuntimeBuilder.scala index da4cb4fac745f..604054c03981a 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/RuntimeBuilder.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/RuntimeBuilder.scala @@ -19,11 +19,10 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5.runtime -import org.neo4j.cypher.internal.util.v3_5.InvalidArgumentException +import org.opencypher.v9_0.util.{InvalidArgumentException, RuntimeUnsupportedNotification} import org.neo4j.cypher.internal.compatibility.v3_5.runtime.phases.CompilationState import org.neo4j.cypher.internal.compiler.v3_5.phases._ -import org.neo4j.cypher.internal.frontend.v3_5.notification.RuntimeUnsupportedNotification -import org.neo4j.cypher.internal.frontend.v3_5.phases.{Do, Transformer} +import org.opencypher.v9_0.frontend.phases.{Do, Transformer} trait RuntimeBuilder[T <: Transformer[_, _, _]] { def create(runtimeName: Option[RuntimeName], useErrorsOverWarnings: Boolean): T diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/DefaultExecutionResultBuilderFactory.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/DefaultExecutionResultBuilderFactory.scala index 080ba3a65856d..448a65d424292 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/DefaultExecutionResultBuilderFactory.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/DefaultExecutionResultBuilderFactory.scala @@ -21,15 +21,15 @@ package org.neo4j.cypher.internal.compatibility.v3_5.runtime.executionplan import org.neo4j.cypher.internal.compatibility.v3_5.runtime._ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.helpers.InternalWrapping._ -import org.neo4j.cypher.internal.frontend.v3_5.PlannerName -import org.neo4j.cypher.internal.frontend.v3_5.phases.InternalNotificationLogger +import org.opencypher.v9_0.frontend.PlannerName +import org.opencypher.v9_0.frontend.phases.InternalNotificationLogger import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities import org.neo4j.cypher.internal.runtime.interpreted.pipes._ import org.neo4j.cypher.internal.runtime.interpreted.{CSVResources, ExecutionContext} import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments.{Runtime, RuntimeImpl} import org.neo4j.cypher.internal.runtime.planDescription.{InternalPlanDescription, LogicalPlan2PlanDescription} import org.neo4j.cypher.internal.runtime.{InternalExecutionResult, _} -import org.neo4j.cypher.internal.util.v3_5.{CypherException, ProfilerStatisticsNotReadyException, TaskCloser} +import org.opencypher.v9_0.util.{CypherException, ProfilerStatisticsNotReadyException, TaskCloser} import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan import org.neo4j.values.virtual.MapValue diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/ExecutionPlan.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/ExecutionPlan.scala index 0c812a969abd5..919df58b36483 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/ExecutionPlan.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/ExecutionPlan.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.compatibility.v3_5.runtime.executionplan import org.neo4j.cypher.internal.ReusabilityState import org.neo4j.cypher.internal.compatibility.v3_5.runtime.RuntimeName -import org.neo4j.cypher.internal.frontend.v3_5.PlannerName +import org.opencypher.v9_0.frontend.PlannerName import org.neo4j.cypher.internal.runtime.{ExecutionMode, InternalExecutionResult, QueryContext} import org.neo4j.cypher.internal.v3_5.logical.plans.IndexUsage import org.neo4j.values.virtual.MapValue diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/ExecutionResultBuilder.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/ExecutionResultBuilder.scala index 022d3f7bb74cf..5efa8701c86d1 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/ExecutionResultBuilder.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/ExecutionResultBuilder.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5.runtime.executionplan -import org.neo4j.cypher.internal.util.v3_5.CypherException +import org.opencypher.v9_0.util.CypherException import org.neo4j.cypher.internal.compatibility.v3_5.runtime.RuntimeName -import org.neo4j.cypher.internal.frontend.v3_5.PlannerName -import org.neo4j.cypher.internal.frontend.v3_5.phases.InternalNotificationLogger +import org.opencypher.v9_0.frontend.PlannerName +import org.opencypher.v9_0.frontend.phases.InternalNotificationLogger import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities import org.neo4j.cypher.internal.runtime.interpreted.pipes.PipeDecorator import org.neo4j.cypher.internal.runtime.{ExecutionMode, InternalExecutionResult, QueryContext} diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/LoadCsvPeriodicCommitObserver.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/LoadCsvPeriodicCommitObserver.scala index 3fec4d4e4999a..f8dddb43514ee 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/LoadCsvPeriodicCommitObserver.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/LoadCsvPeriodicCommitObserver.scala @@ -23,7 +23,7 @@ import java.net.URL import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.ExternalCSVResource -import org.neo4j.cypher.internal.util.v3_5.{CypherException, LoadCsvStatusWrapCypherException} +import org.opencypher.v9_0.util.{CypherException, LoadCsvStatusWrapCypherException} class LoadCsvPeriodicCommitObserver(batchRowCount: Long, resources: ExternalCSVResource, queryContext: QueryContext) extends ExternalCSVResource with ((CypherException) => CypherException) { diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/StandardInternalExecutionResult.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/StandardInternalExecutionResult.scala index ea8bb9b32cc68..9e974d65376e8 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/StandardInternalExecutionResult.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/StandardInternalExecutionResult.scala @@ -25,7 +25,7 @@ import java.util import org.neo4j.cypher.internal.compatibility.v3_5.runtime._ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.helpers.{MapBasedRow, RuntimeTextValueConverter} import org.neo4j.cypher.internal.runtime._ -import org.neo4j.cypher.internal.util.v3_5.{Eagerly, TaskCloser} +import org.opencypher.v9_0.util.{Eagerly, TaskCloser} import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments.{Runtime, RuntimeImpl} import org.neo4j.cypher.result.QueryResult diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/procs/ProcedureCallExecutionPlan.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/procs/ProcedureCallExecutionPlan.scala index 2a6a66d30a9da..b5b76c2e40c17 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/procs/ProcedureCallExecutionPlan.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/procs/ProcedureCallExecutionPlan.scala @@ -31,10 +31,10 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Liter import org.neo4j.cypher.internal.runtime.interpreted.pipes.{ExternalCSVResource, QueryState} import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments._ import org.neo4j.cypher.internal.runtime.planDescription.{Argument, NoChildren, PlanDescriptionImpl} -import org.neo4j.cypher.internal.util.v3_5.TaskCloser -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.symbols.CypherType -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.util.TaskCloser +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.symbols.CypherType +import org.opencypher.v9_0.expressions.Expression import org.neo4j.cypher.internal.v3_5.logical.plans.ProcedureSignature import org.neo4j.graphdb.Notification import org.neo4j.values.virtual.MapValue diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/procs/ProcedureCallOrSchemaCommandExecutionPlanBuilder.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/procs/ProcedureCallOrSchemaCommandExecutionPlanBuilder.scala index f45b741049352..ca5ffdcbdb09e 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/procs/ProcedureCallOrSchemaCommandExecutionPlanBuilder.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/procs/ProcedureCallOrSchemaCommandExecutionPlanBuilder.scala @@ -24,14 +24,14 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.executionplan.Execut import org.neo4j.cypher.internal.compatibility.v3_5.runtime.helpers.InternalWrapping._ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.phases.CompilationState import org.neo4j.cypher.internal.compiler.v3_5.phases._ -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.PIPE_BUILDING -import org.neo4j.cypher.internal.frontend.v3_5.phases.{Condition, Phase} +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase.PIPE_BUILDING +import org.opencypher.v9_0.frontend.phases.{Condition, Phase} import org.neo4j.cypher.internal.planner.v3_5.spi.IndexDescriptor import org.neo4j.cypher.internal.runtime.interpreted.commands.convert.{CommunityExpressionConverter, ExpressionConverters} import org.neo4j.cypher.internal.runtime.{QueryContext, SCHEMA_WRITE} -import org.neo4j.cypher.internal.util.v3_5.{LabelId, PropertyKeyId} -import org.neo4j.cypher.internal.v3_5.expressions.{LabelName, PropertyKeyName, RelTypeName} +import org.opencypher.v9_0.util.{LabelId, PropertyKeyId} +import org.opencypher.v9_0.expressions.{LabelName, PropertyKeyName, RelTypeName} import org.neo4j.cypher.internal.v3_5.logical.plans._ import scala.util.{Failure, Success, Try} diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/procs/ProcedureExecutionResult.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/procs/ProcedureExecutionResult.scala index 101c15b01f8fc..f5f8a6cacc0f7 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/procs/ProcedureExecutionResult.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/procs/ProcedureExecutionResult.scala @@ -28,8 +28,8 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.executionplan.Standa import org.neo4j.cypher.internal.runtime._ import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments.{Runtime, RuntimeImpl} -import org.neo4j.cypher.internal.util.v3_5.symbols.{CypherType, _} -import org.neo4j.cypher.internal.util.v3_5.{ProfilerStatisticsNotReadyException, TaskCloser} +import org.opencypher.v9_0.util.symbols.{CypherType, _} +import org.opencypher.v9_0.util.{ProfilerStatisticsNotReadyException, TaskCloser} import org.neo4j.cypher.internal.v3_5.logical.plans.QualifiedName import org.neo4j.cypher.result.QueryResult.{QueryResultVisitor, Record} import org.neo4j.graphdb.Notification diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/procs/PureSideEffectExecutionPlan.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/procs/PureSideEffectExecutionPlan.scala index 00d4a81309d97..dad68832b04c3 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/procs/PureSideEffectExecutionPlan.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/procs/PureSideEffectExecutionPlan.scala @@ -23,13 +23,13 @@ import org.neo4j.cypher.CypherVersion import org.neo4j.cypher.internal.{FineToReuse, ReusabilityState} import org.neo4j.cypher.internal.compatibility.v3_5.runtime._ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.executionplan.ExecutionPlan -import org.neo4j.cypher.internal.frontend.v3_5.PlannerName +import org.opencypher.v9_0.frontend.PlannerName import org.neo4j.cypher.internal.planner.v3_5.spi.{GraphStatistics, ProcedurePlannerName} import org.neo4j.cypher.internal.runtime._ import org.neo4j.cypher.internal.runtime.interpreted.UpdateCountingQueryContext import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments._ import org.neo4j.cypher.internal.runtime.planDescription.{NoChildren, PlanDescriptionImpl} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.virtual.MapValue /** diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/helpers/InternalWrapping.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/helpers/InternalWrapping.scala index ddf476a0b527c..e502a76fe80a4 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/helpers/InternalWrapping.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/helpers/InternalWrapping.scala @@ -19,8 +19,7 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5.runtime.helpers -import org.neo4j.cypher.internal.frontend.v3_5.notification.{DeprecatedPlannerNotification, InternalNotification, PlannerUnsupportedNotification, RuntimeUnsupportedNotification, _} -import org.neo4j.cypher.internal.util.v3_5.InputPosition +import org.opencypher.v9_0.util._ import org.neo4j.graphdb import org.neo4j.graphdb.impl.notification.{NotificationCode, NotificationDetail} diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/helpers/simpleExpressionEvaluator.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/helpers/simpleExpressionEvaluator.scala index 942f2990a208e..3444b15d76973 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/helpers/simpleExpressionEvaluator.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/helpers/simpleExpressionEvaluator.scala @@ -19,12 +19,12 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5.runtime.helpers -import org.neo4j.cypher.internal.util.v3_5.{CypherException => InternalCypherException} +import org.opencypher.v9_0.util.{CypherException => InternalCypherException} import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.ExpressionEvaluator import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.convert.{CommunityExpressionConverter, ExpressionConverters} import org.neo4j.cypher.internal.runtime.interpreted.pipes.{NullPipeDecorator, QueryState} -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.expressions.Expression import org.neo4j.values.virtual.VirtualValues import scala.collection.mutable diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/profiler/Profiler.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/profiler/Profiler.scala index 6f3bcd93b28f1..103ab15d4aabf 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/profiler/Profiler.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/profiler/Profiler.scala @@ -26,7 +26,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.{DelegatingOperations, Dele import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments import org.neo4j.cypher.internal.runtime.{Operations, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.helpers.MathUtil import org.neo4j.internal.kernel.api.helpers.RelationshipSelectionCursor import org.neo4j.kernel.impl.api.RelationshipVisitor diff --git a/community/cypher/cypher/src/test/java/org/neo4j/cypher/QueryExecutionMonitorTest.scala b/community/cypher/cypher/src/test/java/org/neo4j/cypher/QueryExecutionMonitorTest.scala index 9667574df99c9..f08ea521aca6b 100644 --- a/community/cypher/cypher/src/test/java/org/neo4j/cypher/QueryExecutionMonitorTest.scala +++ b/community/cypher/cypher/src/test/java/org/neo4j/cypher/QueryExecutionMonitorTest.scala @@ -22,7 +22,6 @@ package org.neo4j.cypher import org.mockito.ArgumentMatchers._ import org.mockito.Mockito._ import org.neo4j.cypher.ExecutionEngineHelper.createEngine -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.ExecutionEngine import org.neo4j.cypher.internal.javacompat.GraphDatabaseCypherService import org.neo4j.graphdb.Result @@ -31,6 +30,7 @@ import org.neo4j.kernel.GraphDatabaseQueryService import org.neo4j.kernel.api.query.ExecutingQuery import org.neo4j.kernel.impl.query.{QueryExecutionMonitor, TransactionalContext} import org.neo4j.test.TestGraphDatabaseFactory +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import scala.collection.JavaConverters._ import scala.collection.immutable.Map diff --git a/community/cypher/cypher/src/test/java/org/neo4j/cypher/QueryInvalidationIT.java b/community/cypher/cypher/src/test/java/org/neo4j/cypher/QueryInvalidationIT.java index cdb149bee64bf..48208ebee628c 100644 --- a/community/cypher/cypher/src/test/java/org/neo4j/cypher/QueryInvalidationIT.java +++ b/community/cypher/cypher/src/test/java/org/neo4j/cypher/QueryInvalidationIT.java @@ -29,7 +29,7 @@ import java.util.concurrent.atomic.AtomicLong; import org.neo4j.cypher.internal.compatibility.CypherCacheHitMonitor; -import org.neo4j.cypher.internal.frontend.v3_5.ast.Query; +import org.opencypher.v9_0.ast.Query; import org.neo4j.graphdb.Label; import org.neo4j.graphdb.Result; import org.neo4j.graphdb.Transaction; diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/ErrorMessagesTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/ErrorMessagesTest.scala index bc8bfb5f0e6bc..86a9bfe69a417 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/ErrorMessagesTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/ErrorMessagesTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher import org.hamcrest.CoreMatchers._ import org.junit.Assert._ -import org.neo4j.cypher.internal.frontend.v3_5.helpers.StringHelper._ +import org.opencypher.v9_0.util.helpers.StringHelper._ class ErrorMessagesTest extends ExecutionEngineFunSuite { diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/ExecutionEngineFunSuite.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/ExecutionEngineFunSuite.scala index 734ed1403e40b..d5446d9dd8271 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/ExecutionEngineFunSuite.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/ExecutionEngineFunSuite.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.{Node, PropertyContainer, Result} import org.neo4j.kernel.api.exceptions.Status import org.scalatest.matchers.{MatchResult, Matcher} diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/ExecutionEngineIT.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/ExecutionEngineIT.scala index fcf73bb90cd9e..b4b5619db68ce 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/ExecutionEngineIT.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/ExecutionEngineIT.scala @@ -19,15 +19,12 @@ */ package org.neo4j.cypher -import org.neo4j.cypher.internal.ExecutionEngine import org.neo4j.cypher.internal.javacompat.GraphDatabaseCypherService import org.neo4j.cypher.internal.planner.v3_5.spi.CostBasedPlannerName -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite import org.neo4j.graphdb.factory.GraphDatabaseSettings -import org.neo4j.graphdb.{ExecutionPlanDescription, GraphDatabaseService, Result} +import org.neo4j.graphdb.{ExecutionPlanDescription, GraphDatabaseService} import org.neo4j.test.TestGraphDatabaseFactory - -import scala.collection.immutable.Map +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class ExecutionEngineIT extends CypherFunSuite with GraphIcing { diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/ExecutionEngineTestSupport.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/ExecutionEngineTestSupport.scala index 662ce9b860248..8f4d092bf5659 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/ExecutionEngineTestSupport.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/ExecutionEngineTestSupport.scala @@ -28,7 +28,6 @@ import org.neo4j.cypher.internal._ import org.neo4j.cypher.internal.javacompat.{GraphDatabaseCypherService, MonitoringCacheTracer} import org.neo4j.cypher.internal.runtime.{InternalExecutionResult, RuntimeScalaValueConverter} import org.neo4j.cypher.internal.tracing.TimingCompilationTracer -import org.neo4j.cypher.internal.util.v3_5.test_helpers.{CypherFunSuite, CypherTestSupport} import org.neo4j.graphdb.{GraphDatabaseService, Result} import org.neo4j.kernel.GraphDatabaseQueryService import org.neo4j.kernel.configuration.Config @@ -38,6 +37,7 @@ import org.neo4j.logging.{LogProvider, NullLogProvider} import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values import org.neo4j.values.virtual.{MapValue, VirtualValues} +import org.opencypher.v9_0.util.test_helpers.{CypherFunSuite, CypherTestSupport} import scala.collection.JavaConverters._ import scala.collection.Map diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/JoinHintPlanningIntegrationTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/JoinHintPlanningIntegrationTest.scala index 042b2a0f4925b..2d9e1de3e3501 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/JoinHintPlanningIntegrationTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/JoinHintPlanningIntegrationTest.scala @@ -22,8 +22,8 @@ package org.neo4j.cypher import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.QueryGraphSolver import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.idp._ -import org.neo4j.cypher.internal.util.v3_5.Foldable.FoldableAny -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.Foldable.FoldableAny +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.ir.v3_5.RegularPlannerQuery import org.neo4j.cypher.internal.v3_5.logical.plans.{LogicalPlan, NodeHashJoin} import org.scalacheck.Gen diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/PatternGen.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/PatternGen.scala index 5c9ee2231b557..f109ca8518199 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/PatternGen.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/PatternGen.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher import java.util.concurrent.atomic.AtomicInteger -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection.{BOTH, INCOMING, OUTGOING} +import org.opencypher.v9_0.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection.{BOTH, INCOMING, OUTGOING} import org.scalacheck.Gen._ import org.scalacheck.{Gen, Shrink} import org.scalatest.prop.PropertyChecks diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/QueryCachingTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/QueryCachingTest.scala index 78a005740d3e2..a85f0561115f6 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/QueryCachingTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/QueryCachingTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher import org.neo4j.cypher.internal.StringCacheMonitor -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.Label import org.neo4j.kernel.api.Statement import org.neo4j.kernel.impl.core.ThreadToStatementContextBridge diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/QueryPlanTestSupport.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/QueryPlanTestSupport.scala index 94ffc2790ddb1..5c6264e8cc899 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/QueryPlanTestSupport.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/QueryPlanTestSupport.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher -import org.neo4j.cypher.internal.frontend.v3_5.helpers.StringHelper._ +import org.opencypher.v9_0.util.helpers.StringHelper._ import org.neo4j.cypher.internal.runtime.InternalExecutionResult import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments.KeyNames diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/RootPlanAcceptanceTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/RootPlanAcceptanceTest.scala index 97428699d595b..dfff7c8d45e26 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/RootPlanAcceptanceTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/RootPlanAcceptanceTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{InterpretedRuntimeName, RuntimeName} -import org.neo4j.cypher.internal.frontend.v3_5.PlannerName +import org.opencypher.v9_0.frontend.PlannerName import org.neo4j.cypher.internal.planner.v3_5.spi.CostBasedPlannerName import org.neo4j.graphdb.ExecutionPlanDescription diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/SystemPropertyTestSupport.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/SystemPropertyTestSupport.scala index 4d6c8686f1df4..5a4e0f4b68940 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/SystemPropertyTestSupport.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/SystemPropertyTestSupport.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherTestSupport +import org.opencypher.v9_0.util.test_helpers.CypherTestSupport trait SystemPropertyTestSupport { self: CypherTestSupport => diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/SystemPropertyTestSupportTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/SystemPropertyTestSupportTest.scala index 26bdd0f19273b..4d6fbad19a3a6 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/SystemPropertyTestSupportTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/SystemPropertyTestSupportTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher import java.util.Properties -import org.neo4j.cypher.internal.util.v3_5.test_helpers.{CypherFunSuite, CypherTestSupport} +import org.opencypher.v9_0.util.test_helpers.{CypherFunSuite, CypherTestSupport} class SystemPropertyTestSupportTest extends CypherFunSuite { diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/TxCountsTrackingTestSupport.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/TxCountsTrackingTestSupport.scala index 3eed904bf9c05..4e073b43ed44d 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/TxCountsTrackingTestSupport.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/TxCountsTrackingTestSupport.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher -import org.neo4j.cypher.internal.util.v3_5.test_helpers.{CypherFunSuite, CypherTestSupport} +import org.opencypher.v9_0.util.test_helpers.{CypherFunSuite, CypherTestSupport} import org.neo4j.cypher.internal.runtime.InternalExecutionResult trait TxCountsTrackingTestSupport extends CypherTestSupport { diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/PlanStalenessCallerTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/PlanStalenessCallerTest.scala index 61e3b9591932a..728baa903e358 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/PlanStalenessCallerTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/PlanStalenessCallerTest.scala @@ -24,10 +24,10 @@ import java.util.concurrent.TimeUnit.{MILLISECONDS, SECONDS} import org.mockito.Mockito.when import org.neo4j.cypher.internal.compiler.v3_5.StatsDivergenceCalculator import org.neo4j.cypher.internal.planner.v3_5.spi.{GraphStatistics, GraphStatisticsSnapshot, NodesWithLabelCardinality} -import org.neo4j.cypher.internal.util.v3_5.LabelId -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite import org.neo4j.kernel.impl.query.TransactionalContext import org.neo4j.time.{Clocks, FakeClock} +import org.opencypher.v9_0.util.LabelId +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class PlanStalenessCallerTest extends CypherFunSuite { diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/PreParserTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/PreParserTest.scala index ed5f113f87af4..8d3029952657a 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/PreParserTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/PreParserTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal import org.neo4j.cypher.{CypherPlanner, CypherRuntime, CypherVersion, InvalidArgumentException} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class PreParserTest extends CypherFunSuite { diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/codegen/CompiledConversionUtilsTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/codegen/CompiledConversionUtilsTest.scala index b471a8f225226..015ecffa60225 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/codegen/CompiledConversionUtilsTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/codegen/CompiledConversionUtilsTest.scala @@ -23,9 +23,9 @@ import java.util import java.util.stream.{DoubleStream, IntStream, LongStream} import org.mockito.Mockito.when -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.cypher.internal.codegen.CompiledConversionUtils.makeValueNeoSafe -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.{Node, Relationship} import org.neo4j.kernel.impl.util.ValueUtils import org.neo4j.values.storable._ diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/codegen/CompiledCursorUtilsTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/codegen/CompiledCursorUtilsTest.scala index 3ed6bba370e96..eb7fc354cdaf5 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/codegen/CompiledCursorUtilsTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/codegen/CompiledCursorUtilsTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.codegen import org.mockito.Mockito.when import org.neo4j.cypher.internal.codegen.CompiledCursorUtils.{nodeGetProperty, nodeHasLabel, relationshipGetProperty} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.internal.kernel.api.exceptions.EntityNotFoundException import org.neo4j.internal.kernel.api.{NodeCursor, PropertyCursor, Read, RelationshipScanCursor} import org.neo4j.values.storable.Values.{NO_VALUE, stringValue} diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/codegen/CompiledMathHelperTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/codegen/CompiledMathHelperTest.scala index 6edc76a37cbbd..9f8418e3c71fc 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/codegen/CompiledMathHelperTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/codegen/CompiledMathHelperTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.codegen import java.util -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.kernel.impl.util.ValueUtils import org.neo4j.values.AnyValue import org.neo4j.values.storable._ diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/LFUCacheTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/LFUCacheTest.scala index 0718ab787887b..100003b03a97c 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/LFUCacheTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/LFUCacheTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.compatibility -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class LFUCacheTest extends CypherFunSuite { diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_3/ActiveReadInjectorTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_3/ActiveReadInjectorTest.scala index 52cb3f8bd3756..57594f0e0ecb8 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_3/ActiveReadInjectorTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_3/ActiveReadInjectorTest.scala @@ -20,10 +20,10 @@ package org.neo4j.cypher.internal.compatibility.v3_3 import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 -import org.neo4j.cypher.internal.util.v3_5.attribution.Attributes -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection.OUTGOING -import org.neo4j.cypher.internal.v3_5.expressions.{LabelName, PropertyKeyName, RelTypeName, SignedDecimalIntegerLiteral} +import org.opencypher.v9_0.util.attribution.Attributes +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection.OUTGOING +import org.opencypher.v9_0.expressions.{LabelName, PropertyKeyName, RelTypeName, SignedDecimalIntegerLiteral} import org.neo4j.cypher.internal.v3_5.logical.plans._ import org.scalatest.Matchers diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_3/LogicalPlanConverterTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_3/LogicalPlanConverterTest.scala index 23c0128065e52..b9cf04f4049d7 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_3/LogicalPlanConverterTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_3/LogicalPlanConverterTest.scala @@ -24,18 +24,18 @@ import java.lang.reflect.Modifier import org.neo4j.cypher.internal.compiler.{v3_3 => compilerV3_3} import org.neo4j.cypher.internal.compatibility.v3_3.SemanticTableConverter.ExpressionMapping3To4 import org.neo4j.cypher.internal.frontend.v3_3.{InputPosition => InputPositionV3_3, SemanticDirection => SemanticDirectionV3_3, ast => astV3_3, symbols => symbolsV3_3} -import org.neo4j.cypher.internal.frontend.v3_5.{ast => astv3_5} +import org.opencypher.v9_0.{ast => astv3_5} import org.neo4j.cypher.internal.frontend.{v3_3 => frontendV3_3} import org.neo4j.cypher.internal.ir.{v3_3 => irV3_3, v3_5 => irv3_5} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} -import org.neo4j.cypher.internal.util.v3_5.attribution.SequentialIdGen -import org.neo4j.cypher.internal.util.v3_5.{InputPosition, NonEmptyList, symbols => symbolsv3_5} -import org.neo4j.cypher.internal.util.{v3_5 => utilv3_5} +import org.opencypher.v9_0.util.attribution.SequentialIdGen +import org.opencypher.v9_0.util.{InputPosition, NonEmptyList, symbols => symbolsv3_5} +import org.opencypher.v9_0.{util => utilv3_5} import org.neo4j.cypher.internal.v3_3.logical.{plans => plansV3_3} -import org.neo4j.cypher.internal.v3_5.expressions.{PathExpression, SemanticDirection} +import org.opencypher.v9_0.expressions.{PathExpression, SemanticDirection} import org.neo4j.cypher.internal.v3_5.logical.plans.{ErrorPlan, ProcedureCall} import org.neo4j.cypher.internal.v3_5.logical.{plans => plansv3_5} -import org.neo4j.cypher.internal.v3_5.{expressions => expressionsv3_5} +import org.opencypher.v9_0.{expressions => expressionsv3_5} import org.reflections.Reflections import org.scalatest.{FunSuite, Matchers} diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/CheckForEagerLoadCsvTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/CheckForEagerLoadCsvTest.scala index 56f81c4e6bfaa..58d472649bbec 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/CheckForEagerLoadCsvTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/CheckForEagerLoadCsvTest.scala @@ -20,11 +20,11 @@ package org.neo4j.cypher.internal.compatibility.v3_5 import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.notification.EagerLoadCsvNotification import org.neo4j.cypher.internal.ir.v3_5.NoHeaders -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.StringLiteral +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.StringLiteral import org.neo4j.cypher.internal.v3_5.logical.plans.{AllNodesScan, Eager, LoadCSV} +import org.opencypher.v9_0.util.EagerLoadCsvNotification class CheckForEagerLoadCsvTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/CheckForLoadCsvAndMatchOnLargeLabelTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/CheckForLoadCsvAndMatchOnLargeLabelTest.scala index 0fd8960e3403a..aa53517a18fc1 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/CheckForLoadCsvAndMatchOnLargeLabelTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/CheckForLoadCsvAndMatchOnLargeLabelTest.scala @@ -24,12 +24,11 @@ import org.mockito.Mockito._ import org.mockito.invocation.InvocationOnMock import org.mockito.stubbing.Answer import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.notification.LargeLabelWithLoadCsvNotification import org.neo4j.cypher.internal.ir.v3_5.HasHeaders import org.neo4j.cypher.internal.planner.v3_5.spi.{GraphStatistics, PlanContext} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, LabelId} -import org.neo4j.cypher.internal.v3_5.expressions.{LabelName, StringLiteral} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.{Cardinality, LabelId, LargeLabelWithLoadCsvNotification} +import org.opencypher.v9_0.expressions.{LabelName, StringLiteral} import org.neo4j.cypher.internal.v3_5.logical.plans._ class CheckForLoadCsvAndMatchOnLargeLabelTest diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/CypherCompilerAstCacheAcceptanceTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/CypherCompilerAstCacheAcceptanceTest.scala index b132b07e022fb..dd1bcbab0efe4 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/CypherCompilerAstCacheAcceptanceTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/CypherCompilerAstCacheAcceptanceTest.scala @@ -26,15 +26,15 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.phases.CompilationSt import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{CommunityRuntimeBuilder, CommunityRuntimeContext, CommunityRuntimeContextCreator} import org.neo4j.cypher.internal.compiler.v3_5._ import org.neo4j.cypher.internal.compiler.v3_5.phases.LogicalPlanState -import org.neo4j.cypher.internal.frontend.v3_5.ast.Statement -import org.neo4j.cypher.internal.frontend.v3_5.phases.{CompilationPhaseTracer, Transformer} -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.{CacheTracer, PreParsedQuery} import org.neo4j.graphdb.config.Setting import org.neo4j.graphdb.factory.GraphDatabaseSettings import org.neo4j.logging.AssertableLogProvider.inLog import org.neo4j.logging.{AssertableLogProvider, Log, NullLog} +import org.opencypher.v9_0.ast.Statement +import org.opencypher.v9_0.frontend.phases.{CompilationPhaseTracer, Transformer} +import org.opencypher.v9_0.util.DummyPosition +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import scala.collection.Map diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ClosingIteratorTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ClosingIteratorTest.scala index c64cfd5d61042..1fc71b83641b4 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ClosingIteratorTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ClosingIteratorTest.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.compatibility.v3_5.runtime import org.mockito.ArgumentMatchers.anyBoolean import org.mockito.Mockito._ -import org.neo4j.cypher.internal.util.v3_5.{CypherException, TaskCloser} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.{CypherException, TaskCloser} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values.intValue diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/PipeExecutionPlanBuilderIT.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/PipeExecutionPlanBuilderIT.scala index cd2180f88429e..fe6c8ea43ef97 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/PipeExecutionPlanBuilderIT.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/PipeExecutionPlanBuilderIT.scala @@ -21,7 +21,6 @@ package org.neo4j.cypher.internal.compatibility.v3_5.runtime import org.mockito.Mockito.{atLeastOnce, verify, when} import org.neo4j.cypher.internal.compiler.v3_5.planner._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.planner.v3_5.spi.PlanContext import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities @@ -32,10 +31,11 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.values.KeyToken.Re import org.neo4j.cypher.internal.runtime.interpreted.commands.values.TokenType import org.neo4j.cypher.internal.runtime.interpreted.commands.{expressions => legacy} import org.neo4j.cypher.internal.runtime.interpreted.pipes._ -import org.neo4j.cypher.internal.util.v3_5.RelTypeId -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans._ +import org.opencypher.v9_0.ast.semantics.SemanticTable +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.util.RelTypeId +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import scala.collection.mutable diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/PipeExecutionPlanBuilderTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/PipeExecutionPlanBuilderTest.scala index b9d259f1bcc1c..86945fdfac32f 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/PipeExecutionPlanBuilderTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/PipeExecutionPlanBuilderTest.scala @@ -25,8 +25,8 @@ import org.neo4j.cypher.internal.ir.v3_5.PlannerQuery import org.neo4j.cypher.internal.planner.v3_5.spi.TokenContext import org.neo4j.cypher.internal.runtime.interpreted.commands.convert.{CommunityExpressionConverter, ExpressionConverters} import org.neo4j.cypher.internal.runtime.interpreted.pipes._ -import org.neo4j.cypher.internal.util.v3_5.attribution.{Id, SameId} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.attribution.{Id, SameId} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan class PipeExecutionPlanBuilderTest extends CypherFunSuite with LogicalPlanningTestSupport { diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/ExecutionWorkflowBuilderTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/ExecutionWorkflowBuilderTest.scala index ef94343ef7434..c4d09b80042ce 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/ExecutionWorkflowBuilderTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/ExecutionWorkflowBuilderTest.scala @@ -23,11 +23,11 @@ import org.mockito.ArgumentMatchers._ import org.mockito.Mockito._ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{EagerResultIterator, _} import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanConstructionTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.phases.{InternalNotificationLogger, devNullLogger} +import org.opencypher.v9_0.frontend.phases.{InternalNotificationLogger, devNullLogger} import org.neo4j.cypher.internal.planner.v3_5.spi.IDPPlannerName import org.neo4j.cypher.internal.runtime.interpreted.pipes.Pipe import org.neo4j.cypher.internal.runtime._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.v3_5.logical.plans.Argument import org.neo4j.values.virtual.MapValue import org.neo4j.values.virtual.VirtualValues.EMPTY_MAP diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/LoadCsvIteratorTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/LoadCsvIteratorTest.scala index a17e6bc126fbc..b57df57d723d6 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/LoadCsvIteratorTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/LoadCsvIteratorTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.compatibility.v3_5.runtime.executionplan import java.net.URL -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class LoadCsvIteratorTest extends CypherFunSuite { diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/LoadCsvPeriodicCommitObserverTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/LoadCsvPeriodicCommitObserverTest.scala index 5f8c681d06ffc..6ffaf75d7141e 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/LoadCsvPeriodicCommitObserverTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/LoadCsvPeriodicCommitObserverTest.scala @@ -26,7 +26,7 @@ import org.mockito.ArgumentMatchers._ import org.mockito.Mockito._ import org.neo4j.cypher.internal.runtime.{QueryContext, QueryTransactionalContext} import org.neo4j.cypher.internal.runtime.interpreted.pipes.ExternalCSVResource -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class LoadCsvPeriodicCommitObserverTest extends CypherFunSuite { diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/builders/PatternGraphBuilderTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/builders/PatternGraphBuilderTest.scala index 954ab93e76634..7804ed83ac8e7 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/builders/PatternGraphBuilderTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/builders/PatternGraphBuilderTest.scala @@ -22,9 +22,9 @@ package org.neo4j.cypher.internal.compatibility.v3_5.runtime.executionplan.build import org.neo4j.cypher.internal.runtime.interpreted.commands.RelatedTo import org.neo4j.cypher.internal.runtime.interpreted.PatternGraphBuilder import org.neo4j.cypher.internal.runtime.interpreted.symbols.SymbolTable -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection class PatternGraphBuilderTest extends CypherFunSuite with PatternGraphBuilder { diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/procs/ProcedureCallExecutionPlanTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/procs/ProcedureCallExecutionPlanTest.scala index b4663a9b42989..c925fedee571c 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/procs/ProcedureCallExecutionPlanTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/executionplan/procs/ProcedureCallExecutionPlanTest.scala @@ -25,10 +25,10 @@ import org.mockito.invocation.InvocationOnMock import org.mockito.stubbing.Answer import org.neo4j.cypher.internal.runtime.interpreted.commands.convert.{CommunityExpressionConverter, ExpressionConverters} import org.neo4j.cypher.internal.runtime.{CloseableResource, NormalMode, QueryContext, QueryTransactionalContext} -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.DummyPosition +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans._ import org.neo4j.internal.kernel.api.Procedures import org.neo4j.values.storable.LongValue diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/helpers/RowIteratorVisitationTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/helpers/RowIteratorVisitationTest.scala index 32ebc9adfc13f..50d03888ebfb6 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/helpers/RowIteratorVisitationTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/helpers/RowIteratorVisitationTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.compatibility.v3_5.runtime.helpers import org.mockito.Mockito.verifyZeroInteractions import org.neo4j.cypher.internal.runtime.RuntimeJavaValueConverter -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.result.QueryResult.{QueryResultVisitor, Record} import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values.{intValue, stringValue} diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/helpers/simpleExpressionEvaluatorTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/helpers/simpleExpressionEvaluatorTest.scala index ac68eae121ef6..f9be5bf71ebbc 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/helpers/simpleExpressionEvaluatorTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/helpers/simpleExpressionEvaluatorTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5.runtime.helpers -import org.neo4j.cypher.internal.util.v3_5.DummyPosition +import org.opencypher.v9_0.util.DummyPosition import org.neo4j.cypher.internal.compatibility.v3_5.runtime.helpers.simpleExpressionEvaluator.isNonDeterministic -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.{FunctionInvocation, FunctionName} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.{FunctionInvocation, FunctionName} class SimpleExpressionEvaluatorTest extends CypherFunSuite { private val pos = DummyPosition(-1) diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/profiler/ProfilerTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/profiler/ProfilerTest.scala index ca7ac85d1108d..d15958f8a2572 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/profiler/ProfilerTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/profiler/ProfilerTest.scala @@ -28,8 +28,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QuerySta import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments._ import org.neo4j.cypher.internal.runtime.planDescription.{PlanDescriptionImpl, _} import org.neo4j.cypher.internal.runtime.{QueryContext, QueryTransactionalContext} -import org.neo4j.cypher.internal.util.v3_5.attribution.{Id, SequentialIdGen} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.attribution.{Id, SequentialIdGen} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.kernel.impl.factory.DatabaseInfo import org.neo4j.values.storable.Values.NO_VALUE diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/CypherPreParserTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/CypherPreParserTest.scala index 2c2f3a287e749..f869303be9821 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/CypherPreParserTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/CypherPreParserTest.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.compiler import org.neo4j.cypher.internal._ -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.InputPosition +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.scalatest.prop.TableDrivenPropertyChecks class CypherPreParserTest extends CypherFunSuite with TableDrivenPropertyChecks { diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/ActualCostCalculationTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/ActualCostCalculationTest.scala index 79c9caf4ef1b0..39e870693aeb7 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/ActualCostCalculationTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/ActualCostCalculationTest.scala @@ -24,7 +24,7 @@ import java.nio.file.Files import java.util.concurrent.TimeUnit import org.apache.commons.math3.stat.regression.{OLSMultipleLinearRegression, SimpleRegression} -import org.neo4j.cypher.internal.frontend.v3_5.phases.devNullLogger +import org.opencypher.v9_0.frontend.phases.devNullLogger import org.neo4j.cypher.internal.javacompat.GraphDatabaseCypherService import org.neo4j.cypher.internal.runtime.interpreted.TransactionBoundQueryContext.IndexSearchMonitor import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Literal, Property, Variable} @@ -32,9 +32,9 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.Equals import org.neo4j.cypher.internal.runtime.interpreted.commands.values.TokenType.PropertyKey import org.neo4j.cypher.internal.runtime.interpreted.pipes._ import org.neo4j.cypher.internal.runtime.interpreted.{QueryStateHelper, TransactionBoundPlanContext, TransactionBoundQueryContext, TransactionalContextWrapper} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.util.v3_5.{LabelId, PropertyKeyId} -import org.neo4j.cypher.internal.v3_5.expressions.{LabelToken, PropertyKeyToken, SemanticDirection} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.{LabelId, PropertyKeyId} +import org.opencypher.v9_0.expressions.{LabelToken, PropertyKeyToken, SemanticDirection} import org.neo4j.cypher.internal.v3_5.logical.plans.SingleQueryExpression import org.neo4j.graphdb._ import org.neo4j.internal.kernel.api.Transaction.Type diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/PathExpressionTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/PathExpressionTest.scala index 571d6ac6976b7..2189530a96447 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/PathExpressionTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/PathExpressionTest.scala @@ -26,7 +26,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Shorte import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.{NonEmpty, True} import org.neo4j.cypher.internal.runtime.interpreted.commands.values.UnresolvedLabel import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateTestSupport} -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.kernel.impl.util.ValueUtils.fromNodeProxy import org.neo4j.values.storable.Values.{FALSE, TRUE} import org.neo4j.values.virtual.PathValue diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/PatternMatchingTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/PatternMatchingTest.scala index 8279a3aad12b1..dc3e5e869d946 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/PatternMatchingTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/PatternMatchingTest.scala @@ -29,8 +29,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.values.UnresolvedL import org.neo4j.cypher.internal.runtime.interpreted.pipes.matching.PatternMatchingBuilder import org.neo4j.cypher.internal.runtime.interpreted.symbols.SymbolTable import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, PatternGraphBuilder, QueryStateTestSupport} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.expressions.SemanticDirection class PatternMatchingTest extends ExecutionEngineFunSuite with PatternGraphBuilder with QueryStateTestSupport { val symbols = SymbolTable(Map("a" -> CTNode)) diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/PatternNodeTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/PatternNodeTest.scala index e32daca74e0a3..2dfccca14b907 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/PatternNodeTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/PatternNodeTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.compiler.v3_5 import org.neo4j.cypher.GraphDatabaseFunSuite import org.neo4j.cypher.internal.runtime.interpreted.pipes.matching.{MatchingPair, PatternNode} -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection class PatternNodeTest extends GraphDatabaseFunSuite { test("returns pattern relationships") { diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/PipeLazynessTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/PipeLazynessTest.scala index af7ccbd55cfc3..9473775aa4a3b 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/PipeLazynessTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/PipeLazynessTest.scala @@ -26,8 +26,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Short import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.True import org.neo4j.cypher.internal.runtime.interpreted.pipes._ import org.neo4j.cypher.internal.runtime.interpreted.QueryStateTestSupport -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.graphdb._ import scala.collection.JavaConverters._ diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/ScalaPatternMatchingTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/ScalaPatternMatchingTest.scala index d2b046279e07f..e946f1ed167af 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/ScalaPatternMatchingTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_4/ScalaPatternMatchingTest.scala @@ -27,8 +27,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Litera import org.neo4j.cypher.internal.runtime.interpreted.pipes.matching.PatternMatchingBuilder import org.neo4j.cypher.internal.runtime.interpreted.symbols.SymbolTable import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, PatternGraphBuilder, QueryStateTestSupport} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.expressions.SemanticDirection class ScalaPatternMatchingTest extends ExecutionEngineFunSuite with PatternGraphBuilder with QueryStateTestSupport { val symbols = SymbolTable(Map("a" -> CTNode)) diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/javacompat/ResultRowImplTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/javacompat/ResultRowImplTest.scala index f53dab5a41956..d9698fd4e014d 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/javacompat/ResultRowImplTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/javacompat/ResultRowImplTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.javacompat -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class ResultRowImplTest extends CypherFunSuite { test("int can be handled as a Number") { diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/parser/CaseExpressionTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/parser/CaseExpressionTest.scala index c34a80028a4c8..b0d9432c570b4 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/parser/CaseExpressionTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/parser/CaseExpressionTest.scala @@ -22,8 +22,8 @@ package org.neo4j.cypher.internal.parser import org.neo4j.cypher.internal.runtime.interpreted.commands.convert.{CommunityExpressionConverter, ExpressionConverters} import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.{Equals, True} import org.neo4j.cypher.internal.runtime.interpreted.commands.{predicates, expressions => legacy} -import org.neo4j.cypher.internal.v3_5.{expressions => ast} -import org.neo4j.cypher.internal.frontend.v3_5.parser.{Expressions, ParserTest} +import org.opencypher.v9_0.{expressions => ast} +import org.opencypher.v9_0.parser.{Expressions, ParserTest} import org.parboiled.scala._ class CaseExpressionTest extends ParserTest[ast.Expression, legacy.Expression] with Expressions { diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/parser/ExpressionsTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/parser/ExpressionsTest.scala index 0e01e5534c586..24ead75d7f969 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/parser/ExpressionsTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/parser/ExpressionsTest.scala @@ -23,8 +23,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.convert.{Community import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.{Equals, True} import org.neo4j.cypher.internal.runtime.interpreted.commands.values.TokenType.PropertyKey import org.neo4j.cypher.internal.runtime.interpreted.commands.{predicates, expressions => legacy} -import org.neo4j.cypher.internal.v3_5.{expressions => ast} -import org.neo4j.cypher.internal.frontend.v3_5.parser.{Expressions, ParserTest} +import org.opencypher.v9_0.{expressions => ast} +import org.opencypher.v9_0.parser.{Expressions, ParserTest} // TODO: This should be tested without using the legacy expressions and moved to the semantics module class ExpressionsTest extends ParserTest[ast.Expression, legacy.Expression] with Expressions { diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/parser/ListComprehensionTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/parser/ListComprehensionTest.scala index cdb3745069874..8fcb6d80ef4c3 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/parser/ListComprehensionTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/parser/ListComprehensionTest.scala @@ -23,8 +23,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.convert.{Community import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.GreaterThan import org.neo4j.cypher.internal.runtime.interpreted.commands.values.TokenType.PropertyKey import org.neo4j.cypher.internal.runtime.interpreted.commands.{expressions => legacy} -import org.neo4j.cypher.internal.v3_5.{expressions => ast} -import org.neo4j.cypher.internal.frontend.v3_5.parser.{Expressions, ParserTest} +import org.opencypher.v9_0.{expressions => ast} +import org.opencypher.v9_0.parser.{Expressions, ParserTest} import org.parboiled.scala._ class ListComprehensionTest extends ParserTest[ast.ListComprehension, legacy.Expression] with Expressions { diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/parser/MapLiteralTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/parser/MapLiteralTest.scala index 6aec74b310736..38fcf27beabeb 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/parser/MapLiteralTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/parser/MapLiteralTest.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.parser import org.neo4j.cypher.internal.runtime.interpreted.commands.convert.{CommunityExpressionConverter, ExpressionConverters} import org.neo4j.cypher.internal.runtime.interpreted.commands.{expressions => legacy} -import org.neo4j.cypher.internal.v3_5.{expressions => ast} -import org.neo4j.cypher.internal.frontend.v3_5.parser.{Expressions, ParserTest} +import org.opencypher.v9_0.{expressions => ast} +import org.opencypher.v9_0.parser.{Expressions, ParserTest} import org.parboiled.scala._ class MapLiteralTest extends ParserTest[ast.Expression, legacy.Expression] with Expressions { diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/tracing/TimingCompilationTracerTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/tracing/TimingCompilationTracerTest.scala index 28bc15dc8066a..9e30958b9b279 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/tracing/TimingCompilationTracerTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/tracing/TimingCompilationTracerTest.scala @@ -23,9 +23,9 @@ import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit.MILLISECONDS import org.mockito.Mockito.verify -import org.neo4j.cypher.internal.frontend.v3_5.helpers.{closing, using} -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.{LOGICAL_PLANNING, PARSING} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.frontend.helpers.{closing, using} +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase.{LOGICAL_PLANNING, PARSING} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.tracing.CompilationTracer.NO_COMPILATION_TRACING import org.neo4j.cypher.internal.tracing.TimingCompilationTracer.QueryEvent diff --git a/community/cypher/expressions-3.5/ASL-2-header.txt b/community/cypher/expressions-3.5/ASL-2-header.txt deleted file mode 100644 index f1f80695adcd5..0000000000000 --- a/community/cypher/expressions-3.5/ASL-2-header.txt +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (c) ${inceptionYear}-${currentYear} "Neo Technology," -Network Engine for Objects in Lund AB [http://neotechnology.com] - -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. diff --git a/community/cypher/expressions-3.5/LICENSES.txt b/community/cypher/expressions-3.5/LICENSES.txt deleted file mode 100644 index 3689438757721..0000000000000 --- a/community/cypher/expressions-3.5/LICENSES.txt +++ /dev/null @@ -1,291 +0,0 @@ -This file contains the full license text of the included third party -libraries. For an overview of the licenses see the NOTICE.txt file. - - ------------------------------------------------------------------------------- -Apache Software License, Version 2.0 - Apache Commons Lang - parboiled-core - parboiled-scala ------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. - - - ------------------------------------------------------------------------------- -BSD - Scala License - Scala Library ------------------------------------------------------------------------------- - -SCALA LICENSE - -Copyright (c) 2002-2012 EPFL, Lausanne, unless otherwise specified. -All rights reserved. - -This software was developed by the Programming Methods Laboratory of the -Swiss Federal Institute of Technology (EPFL), Lausanne, Switzerland. - -Permission to use, copy, modify, and distribute this software in source -or binary form for any purpose with or without fee is hereby granted, -provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the EPFL nor the names of its contributors - may be used to endorse or promote products derived from this - software without specific prior written permission. - - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - - - ------------------------------------------------------------------------------- -BSD License - Scala Compiler ------------------------------------------------------------------------------- - -Copyright (c) , -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - - diff --git a/community/cypher/expressions-3.5/NOTICE.txt b/community/cypher/expressions-3.5/NOTICE.txt deleted file mode 100644 index 2303e16bccab4..0000000000000 --- a/community/cypher/expressions-3.5/NOTICE.txt +++ /dev/null @@ -1,29 +0,0 @@ -Copyright (c) 2002-2018, "Neo Technology," -Network Engine for Objects in Lund AB [http://neotechnology.com] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. - -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. - -Full license texts are found in LICENSES.txt. - - -Third-party licenses --------------------- - -Apache Software License, Version 2.0 - Apache Commons Lang - parboiled-core - parboiled-scala - -BSD - Scala License - Scala Library - -BSD License - Scala Compiler - diff --git a/community/cypher/expressions-3.5/pom.xml b/community/cypher/expressions-3.5/pom.xml deleted file mode 100644 index 43393ea9da52e..0000000000000 --- a/community/cypher/expressions-3.5/pom.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - org.neo4j - cypher-parent - 3.5.0-SNAPSHOT - ../ - - - 4.0.0 - neo4j-cypher-expression-3.5 - jar - 3.5.0-SNAPSHOT - Neo4j - Cypher Expressions - - Cypher expressions - http://components.neo4j.org/${project.artifactId}/${project.version} - - - scm:git:git://github.com/neo4j/neo4j.git - scm:git:git@github.com:neo4j/neo4j.git - https://github.com/neo4j/neo4j - - - - notice-asl-prefix.txt - ${project.baseUri}/ASL-2-header.txt - org.neo4j.cypher.internal.v3_5.expressions - - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - - - - - - - org.scalastyle - scalastyle-maven-plugin - - - - - - - - - - - - org.neo4j - neo4j-cypher-util-3.5 - ${project.version} - - - - org.neo4j - neo4j-cypher-util-3.5 - ${project.version} - test-jar - test - - - - - - org.scala-lang - scala-library - - - - scala-reflect - org.scala-lang - - - - - - org.scalatest - scalatest_2.11 - - - org.scalacheck - scalacheck_2.11 - - - - - - org.parboiled - parboiled-scala_2.11 - - - - org.apache.commons - commons-lang3 - - - - - diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/AndedPropertyInequalities.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/AndedPropertyInequalities.scala deleted file mode 100644 index 1079c34fa4330..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/AndedPropertyInequalities.scala +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.NonEmptyList - -case class AndedPropertyInequalities( - variable: LogicalVariable, - property: LogicalProperty, - inequalities: NonEmptyList[InequalityExpression] - ) extends Expression { - def position = variable.position -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/ArithmeticExpressions.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/ArithmeticExpressions.scala deleted file mode 100644 index 82d61faa760c7..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/ArithmeticExpressions.scala +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case class Add(lhs: Expression, rhs: Expression)(val position: InputPosition) - extends Expression with BinaryOperatorExpression { - - override def canonicalOperatorSymbol = "+" -} - -case class UnaryAdd(rhs: Expression)(val position: InputPosition) - extends Expression with LeftUnaryOperatorExpression { - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTInteger), outputType = CTInteger), - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) - - override def canonicalOperatorSymbol = "+" -} - -case class Subtract(lhs: Expression, rhs: Expression)(val position: InputPosition) - extends Expression with BinaryOperatorExpression { - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTInteger, CTInteger), outputType = CTInteger), - TypeSignature(argumentTypes = Vector(CTInteger, CTFloat), outputType = CTFloat), - TypeSignature(argumentTypes = Vector(CTFloat, CTFloat), outputType = CTFloat), - TypeSignature(argumentTypes = Vector(CTDuration, CTDuration), outputType = CTDuration), - TypeSignature(argumentTypes = Vector(CTLocalTime, CTDuration), outputType = CTLocalTime), - TypeSignature(argumentTypes = Vector(CTTime, CTDuration), outputType = CTTime), - TypeSignature(argumentTypes = Vector(CTDate, CTDuration), outputType = CTDate), - TypeSignature(argumentTypes = Vector(CTLocalDateTime, CTDuration), outputType = CTLocalDateTime), - TypeSignature(argumentTypes = Vector(CTDateTime, CTDuration), outputType = CTDateTime) - ) - - override def canonicalOperatorSymbol = "-" -} - -case class UnarySubtract(rhs: Expression)(val position: InputPosition) - extends Expression with LeftUnaryOperatorExpression { - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTInteger), outputType = CTInteger), - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) - - override def canonicalOperatorSymbol = "-" -} - -case class Multiply(lhs: Expression, rhs: Expression)(val position: InputPosition) - extends Expression with BinaryOperatorExpression { - - // 1 * 1 => 1 - // 1 * 1.1 => 1.1 - // 1.1 * 1 => 1.1 - // 1.1 * 1.1 => 1.21 - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTInteger, CTInteger), outputType = CTInteger), - TypeSignature(argumentTypes = Vector(CTInteger, CTFloat), outputType = CTFloat), - TypeSignature(argumentTypes = Vector(CTFloat, CTFloat), outputType = CTFloat), - TypeSignature(argumentTypes = Vector(CTDuration, CTFloat), outputType = CTDuration), - TypeSignature(argumentTypes = Vector(CTDuration, CTInteger), outputType = CTDuration), - TypeSignature(argumentTypes = Vector(CTFloat, CTDuration), outputType = CTDuration), - TypeSignature(argumentTypes = Vector(CTInteger, CTDuration), outputType = CTDuration) - ) - - override def canonicalOperatorSymbol = "*" -} - -case class Divide(lhs: Expression, rhs: Expression)(val position: InputPosition) - extends Expression with BinaryOperatorExpression { - - // 1 / 1 => 1 - // 1 / 1.1 => 0.909 - // 1.1 / 1 => 1.1 - // 1.1 / 1.1 => 1.0 - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTInteger, CTInteger), outputType = CTInteger), - TypeSignature(argumentTypes = Vector(CTInteger, CTFloat), outputType = CTFloat), - TypeSignature(argumentTypes = Vector(CTFloat, CTFloat), outputType = CTFloat), - TypeSignature(argumentTypes = Vector(CTDuration, CTFloat), outputType = CTDuration), - TypeSignature(argumentTypes = Vector(CTDuration, CTInteger), outputType = CTDuration) - ) - - override def canonicalOperatorSymbol = "/" -} - -case class Modulo(lhs: Expression, rhs: Expression)(val position: InputPosition) - extends Expression with BinaryOperatorExpression { - - // 1 % 1 => 0 - // 1 % 1.1 => 1.0 - // 1.1 % 1 => 0.1 - // 1.1 % 1.1 => 0.0 - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTInteger, CTInteger), outputType = CTInteger), - TypeSignature(argumentTypes = Vector(CTInteger, CTFloat), outputType = CTFloat), - TypeSignature(argumentTypes = Vector(CTFloat, CTFloat), outputType = CTFloat) - ) - - override def canonicalOperatorSymbol = "%" -} - -case class Pow(lhs: Expression, rhs: Expression)(val position: InputPosition) - extends Expression with BinaryOperatorExpression { - - // 1 ^ 1 => 1.1 - // 1 ^ 1.1 => 1.0 - // 1.1 ^ 1 => 1.1 - // 1.1 ^ 1.1 => 1.1105 - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat, CTFloat), outputType = CTFloat) - ) - - override def canonicalOperatorSymbol = "^" -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/CaseExpression.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/CaseExpression.scala deleted file mode 100644 index 54a0b899ac5cb..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/CaseExpression.scala +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.InputPosition - -case class CaseExpression( - expression: Option[Expression], - alternatives: IndexedSeq[(Expression, Expression)], - default: Option[Expression] - )(val position: InputPosition) extends Expression { - - lazy val possibleExpressions: IndexedSeq[Expression] = alternatives.map(_._2) ++ default - -} - -object CaseExpression { - def apply( - expression: Option[Expression], - alternatives: List[(Expression, Expression)], - default: Option[Expression] - )(position: InputPosition):CaseExpression = - CaseExpression(expression, alternatives.toIndexedSeq, default)(position) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/CoerceTo.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/CoerceTo.scala deleted file mode 100644 index 4cc2334bd76ee..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/CoerceTo.scala +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.symbols.CypherType - -case class CoerceTo(expr: Expression, typ: CypherType) extends Expression { - def position = expr.position -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/ConstantExpression.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/ConstantExpression.scala deleted file mode 100644 index 7371d4b9aa695..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/ConstantExpression.scala +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -object ConstantExpression { - def unapply(v: AnyRef): Option[Expression] = v match { - case expr: Literal => Some(expr) - case expr: Parameter => Some(expr) - case expr@ListLiteral(expressions) if expressions.forall(unapply(_).nonEmpty) => Some(expr) - case _ => None - } -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/CountStar.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/CountStar.scala deleted file mode 100644 index 028279321bc03..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/CountStar.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.InputPosition - -case class CountStar()(val position: InputPosition) extends Expression diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Expression.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Expression.scala deleted file mode 100644 index a438e8fef0a2e..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Expression.scala +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.Foldable._ -import org.neo4j.cypher.internal.util.v3_5._ - -import scala.collection.immutable.Stack - -object Expression { - sealed trait SemanticContext - object SemanticContext { - case object Simple extends SemanticContext - case object Results extends SemanticContext - } - - val DefaultTypeMismatchMessageGenerator = (expected: String, existing: String) => s"expected $expected but was $existing" - - final case class TreeAcc[A](data: A, stack: Stack[Set[LogicalVariable]] = Stack.empty) { - def mapData(f: A => A): TreeAcc[A] = copy(data = f(data)) - - def inScope(variable: LogicalVariable) = stack.exists(_.contains(variable)) - def variablesInScope: Set[LogicalVariable] = stack.toSet.flatten - - def pushScope(newVariable: LogicalVariable): TreeAcc[A] = pushScope(Set(newVariable)) - def pushScope(newVariables: Set[LogicalVariable]): TreeAcc[A] = copy(stack = stack.push(newVariables)) - def popScope: TreeAcc[A] = copy(stack = stack.pop) - } - - def mapExpressionHasPropertyReadDependency(mapEntityName: String, mapExpression: Expression): Boolean = - mapExpression match { - case MapExpression(items) => items.exists { - case (k, v) => v.subExpressions.exists { - case LogicalProperty(LogicalVariable(entityName), propertyKey) => - entityName == mapEntityName && propertyKey == k - case _ => false - } - } - case _ => false - } - - def hasPropertyReadDependency(entityName: String, expression: Expression, propertyKey: PropertyKeyName): Boolean = - expression.subExpressions.exists { - case LogicalProperty(LogicalVariable(name), key) => - name == entityName && key == propertyKey - case _ => - false - } -} - -abstract class Expression extends ASTNode { - - self => - - import Expression.TreeAcc - - def arguments: Seq[Expression] = this.treeFold(List.empty[Expression]) { - case e: Expression if e != this => - acc => (acc :+ e, None) - } - - // Collects all sub-expressions recursively - def subExpressions: Seq[Expression] = this.treeFold(List.empty[Expression]) { - case e: Expression if e != this => - acc => (acc :+ e, Some(identity)) - } - - // All variables referenced from this expression or any of its children - // that are not introduced inside this expression - def dependencies: Set[LogicalVariable] = - this.treeFold(TreeAcc[Set[LogicalVariable]](Set.empty)) { - case scope: ScopeExpression => - acc => - val newAcc = acc.pushScope(scope.introducedVariables) - (newAcc, Some((x) => x.popScope)) - case id: LogicalVariable => acc => { - val newAcc = if (acc.inScope(id)) acc else acc.mapData(_ + id) - (newAcc, Some(identity)) - } - }.data - - // All (free) occurrences of variable in this expression or any of its children - // (i.e. excluding occurrences referring to shadowing redefinitions of variable) - def occurrences(variable: LogicalVariable): Set[Ref[Variable]] = - this.treeFold(TreeAcc[Set[Ref[Variable]]](Set.empty)) { - case scope: ScopeExpression => { - case acc => - val newAcc = acc.pushScope(scope.introducedVariables) - (newAcc, Some((x) => x.popScope)) - } - case occurrence: Variable if occurrence.name == variable.name => acc => { - val newAcc = if (acc.inScope(occurrence)) acc else acc.mapData(_ + Ref(occurrence)) - (newAcc, Some(identity)) - } - }.data - - def copyAndReplace(variable: LogicalVariable) = new { - def by(replacement: => Expression): Expression = { - val replacedOccurences = occurrences(variable) - self.endoRewrite(bottomUp(Rewriter.lift { - case occurrence: Variable if replacedOccurences(Ref(occurrence)) => replacement - })) - } - } - - // List of child expressions together with any of its dependencies introduced - // by any of its parent expressions (where this expression is the root of the tree) - def inputs: Seq[(Expression, Set[LogicalVariable])] = - this.treeFold(TreeAcc[Seq[(Expression, Set[LogicalVariable])]](Seq.empty)) { - case scope: ScopeExpression=> - acc => - val newAcc = acc.pushScope(scope.introducedVariables) - .mapData(pairs => pairs :+ (scope -> acc.variablesInScope)) - (newAcc, Some((x) => x.popScope)) - - case expr: Expression => - acc => - val newAcc = acc.mapData(pairs => pairs :+ (expr -> acc.variablesInScope)) - (newAcc, Some(identity)) - }.data - - /** - * Return true is this expression contains an aggregating expression. - */ - def containsAggregate: Boolean = this.treeExists { - case IsAggregate(_) => true - } - - /** - * Returns the first encountered aggregate expression, or None if none existed. - */ - def findAggregate:Option[Expression] = this.treeFind[Expression] { - case IsAggregate(_) => true - } -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/FunctionInvocation.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/FunctionInvocation.scala deleted file mode 100644 index 1cf59f84b9f60..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/FunctionInvocation.scala +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.v3_5.functions -import org.neo4j.cypher.internal.v3_5.functions.UnresolvedFunction - -object FunctionInvocation { - def apply(name: FunctionName, argument: Expression)(position: InputPosition): FunctionInvocation = - FunctionInvocation(Namespace()(position), name, distinct = false, IndexedSeq(argument))(position) - def apply(left: Expression, name: FunctionName, right: Expression): FunctionInvocation = - FunctionInvocation(Namespace()(name.position), name, distinct = false, IndexedSeq(left, right))(name.position) - def apply(expression: Expression, name: FunctionName): FunctionInvocation = - FunctionInvocation(Namespace()(name.position), name, distinct = false, IndexedSeq(expression))(name.position) - def apply(functionName: FunctionName, distinct: Boolean, args: IndexedSeq[Expression])(position: InputPosition): FunctionInvocation = - FunctionInvocation(Namespace()(position), functionName, distinct, args)(position) -} - -case class FunctionInvocation(namespace: Namespace, functionName: FunctionName, distinct: Boolean, args: IndexedSeq[Expression]) - (val position: InputPosition) extends Expression { - val name: String = (namespace.parts :+ functionName.name).mkString(".") - val function: functions.Function = functions.Function.lookup.getOrElse(name.toLowerCase, UnresolvedFunction) - - def needsToBeResolved: Boolean = function match { - case UnresolvedFunction => true - case _ => false - } - - override def asCanonicalStringVal = s"$name(${args.map(_.asCanonicalStringVal).mkString(",")})" -} - -case class FunctionName(name: String)(val position: InputPosition) extends SymbolicName { - override def equals(x: Any): Boolean = x match { - case FunctionName(other) => other.toLowerCase == name.toLowerCase - case _ => false - } - override def hashCode = name.toLowerCase.hashCode -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/GetDegree.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/GetDegree.scala deleted file mode 100644 index 3f50343029ea7..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/GetDegree.scala +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.InputPosition - -case class GetDegree( - node: Expression, - relType: Option[RelTypeName], - dir: SemanticDirection - )(val position: InputPosition) extends Expression diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/HasLabels.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/HasLabels.scala deleted file mode 100644 index 61a21793ab65b..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/HasLabels.scala +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.InputPosition - -case class HasLabels(expression: Expression, labels: Seq[LabelName])(val position: InputPosition) extends Expression { - - override def asCanonicalStringVal = s"${expression.asCanonicalStringVal}${labels.map(_.asCanonicalStringVal).mkString(":", ":", "")}" -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/IsAggregate.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/IsAggregate.scala deleted file mode 100644 index 4a701d3e195b7..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/IsAggregate.scala +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.v3_5.functions.{AggregatingFunction, UserDefinedFunctionInvocation} - -object IsAggregate { - def unapply(v: Any) = v match { - case expr: CountStar => - Some(expr) - - case fi: FunctionInvocation if fi.distinct => - Some(fi) - - case fi: FunctionInvocation => - fi.function match { - case fun: AggregatingFunction => Some(fi) - case _ => None - } - - case fi: UserDefinedFunctionInvocation if fi.isAggregate => - Some(fi) - - case _ => - None - } - - def apply(e: Expression): Boolean = unapply(e).nonEmpty -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/IterableExpressions.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/IterableExpressions.scala deleted file mode 100644 index bac11a259953c..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/IterableExpressions.scala +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.InputPosition - -trait FilteringExpression extends Expression { - def name: String - def variable: LogicalVariable - def expression: Expression - def innerPredicate: Option[Expression] - - override def arguments = Seq(expression) -} - -case class FilterExpression(scope: FilterScope, expression: Expression)(val position: InputPosition) extends FilteringExpression { - val name = "filter" - - def variable = scope.variable - def innerPredicate = scope.innerPredicate -} - -object FilterExpression { - def apply(variable: Variable, expression: Expression, innerPredicate: Option[Expression])(position: InputPosition): FilterExpression = - FilterExpression(FilterScope(variable, innerPredicate)(position), expression)(position) -} - -case class ExtractExpression(scope: ExtractScope, expression: Expression)(val position: InputPosition) extends FilteringExpression -{ - val name = "extract" - - def variable = scope.variable - def innerPredicate = scope.innerPredicate - def extractExpression = scope.extractExpression -} - -object ExtractExpression { - def apply(variable: Variable, - expression: Expression, - innerPredicate: Option[Expression], - extractExpression: Option[Expression])(position: InputPosition): ExtractExpression = - ExtractExpression(ExtractScope(variable, innerPredicate, extractExpression)(position), expression)(position) -} - -case class ListComprehension(scope: ExtractScope, expression: Expression)(val position: InputPosition) - extends FilteringExpression { - - val name = "[...]" - - def variable = scope.variable - def innerPredicate = scope.innerPredicate - def extractExpression = scope.extractExpression -} - -object ListComprehension { - def apply(variable: Variable, - expression: Expression, - innerPredicate: Option[Expression], - extractExpression: Option[Expression])(position: InputPosition): ListComprehension = - ListComprehension(ExtractScope(variable, innerPredicate, extractExpression)(position), expression)(position) -} - -case class PatternComprehension(namedPath: Option[LogicalVariable], pattern: RelationshipsPattern, - predicate: Option[Expression], projection: Expression, - outerScope: Set[LogicalVariable] = Set.empty) - (val position: InputPosition) - extends ScopeExpression { - - self => - - def withOuterScope(outerScope: Set[LogicalVariable]) = - copy(outerScope = outerScope)(position) - - override val introducedVariables: Set[LogicalVariable] = { - val introducedInternally = namedPath.toSet ++ pattern.element.allVariables - val introducedExternally = introducedInternally -- outerScope - introducedExternally - } -} - -sealed trait IterablePredicateExpression extends FilteringExpression { - - def scope: FilterScope - def variable: LogicalVariable = scope.variable - def innerPredicate: Option[Expression] = scope.innerPredicate - - override def asCanonicalStringVal: String = { - val predicate = innerPredicate.map(p => s" where ${p.asCanonicalStringVal}").getOrElse("") - s"$name(${variable.asCanonicalStringVal}) in ${expression.asCanonicalStringVal}$predicate" - } -} - -case class AllIterablePredicate(scope: FilterScope, expression: Expression)(val position: InputPosition) extends IterablePredicateExpression { - val name = "all" -} - -object AllIterablePredicate { - def apply(variable: LogicalVariable, expression: Expression, innerPredicate: Option[Expression])(position: InputPosition): AllIterablePredicate = - AllIterablePredicate(FilterScope(variable, innerPredicate)(position), expression)(position) -} - -case class AnyIterablePredicate(scope: FilterScope, expression: Expression)(val position: InputPosition) extends IterablePredicateExpression { - val name = "any" -} - -object AnyIterablePredicate { - def apply(variable: LogicalVariable, expression: Expression, innerPredicate: Option[Expression])(position: InputPosition): AnyIterablePredicate = - AnyIterablePredicate(FilterScope(variable, innerPredicate)(position), expression)(position) -} - -case class NoneIterablePredicate(scope: FilterScope, expression: Expression)(val position: InputPosition) extends IterablePredicateExpression { - val name = "none" -} - -object NoneIterablePredicate { - def apply(variable: LogicalVariable, expression: Expression, innerPredicate: Option[Expression])(position: InputPosition): NoneIterablePredicate = - NoneIterablePredicate(FilterScope(variable, innerPredicate)(position), expression)(position) -} - -case class SingleIterablePredicate(scope: FilterScope, expression: Expression)(val position: InputPosition) extends IterablePredicateExpression { - val name = "single" -} - -object SingleIterablePredicate { - def apply(variable: LogicalVariable, expression: Expression, innerPredicate: Option[Expression])(position: InputPosition): SingleIterablePredicate = - SingleIterablePredicate(FilterScope(variable, innerPredicate)(position), expression)(position) -} - -case class ReduceExpression(scope: ReduceScope, init: Expression, list: Expression)(val position: InputPosition) extends Expression { - def variable = scope.variable - def accumulator = scope.accumulator - def expression = scope.expression -} - -object ReduceExpression { - val AccumulatorExpressionTypeMismatchMessageGenerator = (expected: String, existing: String) => s"accumulator is $expected but expression has type $existing" - - def apply(accumulator: Variable, init: Expression, variable: Variable, list: Expression, expression: Expression)(position: InputPosition): ReduceExpression = - ReduceExpression(ReduceScope(accumulator, variable, expression)(position), init, list)(position) -} - diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/ListLiteral.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/ListLiteral.scala deleted file mode 100644 index c2ad9aee5bcfd..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/ListLiteral.scala +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.InputPosition - -case class ListLiteral(expressions: Seq[Expression])(val position: InputPosition) extends Expression { - - def map(f: Expression => Expression) = copy(expressions = expressions.map(f))(position) - - override def asCanonicalStringVal: String = expressions.map(_.asCanonicalStringVal).mkString("[", ", ", "]") -} - -case class ListSlice(list: Expression, from: Option[Expression], to: Option[Expression])(val position: InputPosition) - extends Expression - -case class ContainerIndex(expr: Expression, idx: Expression)(val position: InputPosition) - extends Expression diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Literal.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Literal.scala deleted file mode 100644 index 1153ea0389673..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Literal.scala +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.InputPosition - -sealed trait Literal extends Expression { - def value: AnyRef - def asCanonicalStringVal: String -} - -sealed trait NumberLiteral extends Literal { - def stringVal: String - override def asCanonicalStringVal: String = stringVal -} - -sealed trait IntegerLiteral extends NumberLiteral { - def value: java.lang.Long -} - -sealed trait SignedIntegerLiteral extends IntegerLiteral -sealed trait UnsignedIntegerLiteral extends IntegerLiteral - -sealed abstract class DecimalIntegerLiteral(stringVal: String) extends IntegerLiteral { - lazy val value: java.lang.Long = java.lang.Long.parseLong(stringVal) -} - -case class SignedDecimalIntegerLiteral(stringVal: String)(val position: InputPosition) extends DecimalIntegerLiteral(stringVal) with SignedIntegerLiteral -case class UnsignedDecimalIntegerLiteral(stringVal: String)(val position: InputPosition) extends DecimalIntegerLiteral(stringVal) with UnsignedIntegerLiteral - -sealed abstract class OctalIntegerLiteral(stringVal: String) extends IntegerLiteral { - lazy val value: java.lang.Long = java.lang.Long.parseLong(stringVal, 8) -} - -case class SignedOctalIntegerLiteral(stringVal: String)(val position: InputPosition) extends OctalIntegerLiteral(stringVal) with SignedIntegerLiteral - -sealed abstract class HexIntegerLiteral(stringVal: String) extends IntegerLiteral { - lazy val value: java.lang.Long = - if (stringVal.charAt(0) == '-') - -java.lang.Long.parseLong(stringVal.substring(3), 16) - else - java.lang.Long.parseLong(stringVal.substring(2), 16) -} - -case class SignedHexIntegerLiteral(stringVal: String)(val position: InputPosition) extends HexIntegerLiteral(stringVal) with SignedIntegerLiteral - - -sealed trait DoubleLiteral extends NumberLiteral { - def value: java.lang.Double -} - -case class DecimalDoubleLiteral(stringVal: String)(val position: InputPosition) extends DoubleLiteral { - lazy val value: java.lang.Double = java.lang.Double.parseDouble(stringVal) -} - -case class StringLiteral(value: String)(val position: InputPosition) extends Literal { - override def asCanonicalStringVal = value -} - -case class Null()(val position: InputPosition) extends Literal { - val value = null - - override def asCanonicalStringVal = "NULL" -} - -sealed trait BooleanLiteral extends Literal - -case class True()(val position: InputPosition) extends BooleanLiteral { - val value: java.lang.Boolean = true - - override def asCanonicalStringVal = "true" -} - -case class False()(val position: InputPosition) extends BooleanLiteral { - val value: java.lang.Boolean = false - - override def asCanonicalStringVal = "false" -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/LogicalProperty.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/LogicalProperty.scala deleted file mode 100644 index cac3c38d2a13f..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/LogicalProperty.scala +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -abstract class LogicalProperty extends Expression { - def map: Expression - def propertyKey: PropertyKeyName -} - -object LogicalProperty { - def unapply(p: LogicalProperty): Option[(Expression, PropertyKeyName)] = Some((p.map, p.propertyKey)) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/LogicalVariable.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/LogicalVariable.scala deleted file mode 100644 index a991d1afa9896..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/LogicalVariable.scala +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.InputPosition - -abstract class LogicalVariable extends Expression { - def name: String - - def copyId: LogicalVariable - - def renameId(newName: String): LogicalVariable - - def bumpId: LogicalVariable - - def position: InputPosition -} - -object LogicalVariable { - def unapply(arg: Variable): Option[String] = Some(arg.name) -} - diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/MapExpression.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/MapExpression.scala deleted file mode 100644 index 277351e6425ba..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/MapExpression.scala +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.InputPosition - -case class MapExpression(items: Seq[(PropertyKeyName, Expression)])(val position: InputPosition) extends Expression { - - override def asCanonicalStringVal: String = items.map { - case (key, value) => s"${key.asCanonicalStringVal}: ${value.asCanonicalStringVal}" - }.mkString("{", ", ", "}") -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/MapProjection.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/MapProjection.scala deleted file mode 100644 index fd8462c4fa627..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/MapProjection.scala +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.InputPosition - -case class MapProjection( - name: Variable, // Since this is always rewritten to DesugaredMapProjection this - // (and in the elements below) may not need to be LogicalVariable - items: Seq[MapProjectionElement], - definitionPos: Option[InputPosition] = None) - (val position: InputPosition) - extends Expression { - - def withDefinitionPos(pos:InputPosition): MapProjection = - copy(definitionPos = Some(pos))(position) -} - -sealed trait MapProjectionElement extends Expression - -case class LiteralEntry(key: PropertyKeyName, exp: Expression)(val position: InputPosition) extends MapProjectionElement -case class VariableSelector(id: Variable)(val position: InputPosition) extends MapProjectionElement -case class PropertySelector(id: Variable)(val position: InputPosition) extends MapProjectionElement -case class AllPropertiesSelector()(val position: InputPosition) extends MapProjectionElement diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/NameToken.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/NameToken.scala deleted file mode 100644 index 04d56bad9e9d3..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/NameToken.scala +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.{LabelId, NameId, PropertyKeyId} - -sealed abstract class NameToken[I <: NameId] { - def name: String - def nameId: I -} - -object LabelToken { - def apply(symbolicName: LabelName, nameId: LabelId): LabelToken = LabelToken(symbolicName.name, nameId) -} - -final case class LabelToken(name: String, nameId: LabelId) extends NameToken[LabelId] - -object PropertyKeyToken { - def apply(symbolicName: PropertyKeyName, nameId: PropertyKeyId): PropertyKeyToken = PropertyKeyToken(symbolicName.name, nameId) -} - -final case class PropertyKeyToken(name: String, nameId: PropertyKeyId) extends NameToken[PropertyKeyId] diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/OperatorExpression.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/OperatorExpression.scala deleted file mode 100644 index 8b27d6629f6f5..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/OperatorExpression.scala +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -trait OperatorExpression { - self: Expression => - - def signatures: Seq[TypeSignature] = Seq.empty - - def canonicalOperatorSymbol: String = self.productPrefix.toUpperCase -} - -trait LeftUnaryOperatorExpression extends OperatorExpression { - self: Expression => - - def rhs: Expression - - override def asCanonicalStringVal: String = s"$canonicalOperatorSymbol(${rhs.asCanonicalStringVal})" -} - -trait RightUnaryOperatorExpression extends OperatorExpression { - self: Expression => - - def lhs: Expression - override def asCanonicalStringVal: String = s"$canonicalOperatorSymbol(${lhs.asCanonicalStringVal})" -} - -trait BinaryOperatorExpression extends OperatorExpression { - self: Expression => - - def lhs: Expression - def rhs: Expression - - override def asCanonicalStringVal: String = { - s"${lhs.asCanonicalStringVal} $canonicalOperatorSymbol ${rhs.asCanonicalStringVal}" - } -} - -trait MultiOperatorExpression extends OperatorExpression { - self: Expression => - - def exprs: Set[Expression] - - override def asCanonicalStringVal: String = s"$canonicalOperatorSymbol( ${exprs.map(_.asCanonicalStringVal).mkString(", ")}" -} - diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Parameter.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Parameter.scala deleted file mode 100644 index bd1c5332b816d..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Parameter.scala +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case class Parameter(name: String, - parameterType: CypherType)(val position: InputPosition) - extends Expression { - - override def asCanonicalStringVal: String = s"{$name}" -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/PathExpression.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/PathExpression.scala deleted file mode 100644 index adc25db545b45..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/PathExpression.scala +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.Rewritable._ -import org.neo4j.cypher.internal.util.v3_5.{Foldable, InputPosition, Rewritable} - -sealed trait PathStep extends Product with Foldable with Rewritable { - - self => - - def dependencies: Set[Expression] - - def dup(children: Seq[AnyRef]): this.type = - if (children.iterator eqElements this.children) - this - else { - val constructor = Rewritable.copyConstructor(this) - val params = constructor.getParameterTypes - val args = children.toVector - val ctorArgs = args - val duped = constructor.invoke(this, ctorArgs: _*) - duped.asInstanceOf[self.type] - } -} - -final case class NodePathStep(node: Expression, next: PathStep) extends PathStep { - val dependencies = next.dependencies + node -} - -final case class SingleRelationshipPathStep(rel: Expression, direction: SemanticDirection, next: PathStep) extends PathStep { - val dependencies = next.dependencies + rel -} - -final case class MultiRelationshipPathStep(rel: Expression, direction: SemanticDirection, next: PathStep) extends PathStep { - val dependencies = next.dependencies + rel -} - -case object NilPathStep extends PathStep { - def dependencies = Set.empty[Expression] -} - -case class PathExpression(step: PathStep)(val position: InputPosition) extends Expression diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Pattern.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Pattern.scala deleted file mode 100644 index 9144cd178d9e4..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Pattern.scala +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition} - -object Pattern { - sealed trait SemanticContext - - object SemanticContext { - case object Match extends SemanticContext - case object Merge extends SemanticContext - case object Create extends SemanticContext - case object CreateUnique extends SemanticContext - case object Expression extends SemanticContext - - case object GraphOf extends SemanticContext - - def name(ctx: SemanticContext): String = ctx match { - case Match => "MATCH" - case Merge => "MERGE" - case Create => "CREATE" - case CreateUnique => "CREATE UNIQUE" - case Expression => "expression" - case GraphOf => "GRAPH OF" - } - } - - object findDuplicateRelationships extends (Pattern => Set[Seq[LogicalVariable]]) { - - def apply(pattern: Pattern): Set[Seq[LogicalVariable]] = { - val (seen, duplicates) = pattern.fold((Set.empty[LogicalVariable], Seq.empty[LogicalVariable])) { - case RelationshipChain(_, RelationshipPattern(Some(rel), _, None, _, _, _), _) => - (acc) => - val (seen, duplicates) = acc - - val newDuplicates = if (seen.contains(rel)) duplicates :+ rel else duplicates - val newSeen = seen + rel - - (newSeen, newDuplicates) - - case _ => - identity - } - - val m0: Map[String, Seq[LogicalVariable]] = duplicates.groupBy(_.name) - - val resultMap = seen.foldLeft(m0) { - case (m, ident @ Variable(name)) if m.contains(name) => m.updated(name, Seq(ident) ++ m(name)) - case (m, _) => m - } - - resultMap.values.toSet - } - } -} - -case class Pattern(patternParts: Seq[PatternPart])(val position: InputPosition) extends ASTNode { - - lazy val length = this.fold(0) { - case RelationshipChain(_, _, _) => _ + 1 - case _ => identity - } -} - -case class RelationshipsPattern(element: RelationshipChain)(val position: InputPosition) extends ASTNode - - -sealed abstract class PatternPart extends ASTNode { - def element: PatternElement -} - -case class NamedPatternPart(variable: Variable, patternPart: AnonymousPatternPart)(val position: InputPosition) extends PatternPart { - def element: PatternElement = patternPart.element -} - - -sealed trait AnonymousPatternPart extends PatternPart - -case class EveryPath(element: PatternElement) extends AnonymousPatternPart { - def position = element.position -} - -case class ShortestPaths(element: PatternElement, single: Boolean)(val position: InputPosition) extends AnonymousPatternPart { - val name: String = - if (single) - "shortestPath" - else - "allShortestPaths" -} - -sealed abstract class PatternElement extends ASTNode { - def allVariables: Set[LogicalVariable] - def variable: Option[LogicalVariable] - - def isSingleNode = false -} - -case class RelationshipChain( - element: PatternElement, - relationship: RelationshipPattern, - rightNode: NodePattern - )(val position: InputPosition) - extends PatternElement { - - def variable: Option[LogicalVariable] = relationship.variable - - override def allVariables: Set[LogicalVariable] = element.allVariables ++ relationship.variable ++ rightNode.variable - -} - -object InvalidNodePattern { - def apply(id: Variable, labels: Seq[LabelName], properties: Option[Expression])(position: InputPosition) = - new InvalidNodePattern(id)(position) -} - -class InvalidNodePattern( - val id: LogicalVariable - )( - position: InputPosition -) extends NodePattern(Some(id), Seq.empty, None)(position) { - - override def canEqual(other: Any): Boolean = other.isInstanceOf[InvalidNodePattern] - - override def equals(other: Any): Boolean = other match { - case that: InvalidNodePattern => - (that canEqual this) && - id == that.id - case _ => false - } - - override def hashCode(): Int = 31 * id.hashCode() - - override def allVariables: Set[LogicalVariable] = Set.empty -} - -case class NodePattern(variable: Option[LogicalVariable], - labels: Seq[LabelName], - properties: Option[Expression])(val position: InputPosition) - extends PatternElement { - - override def allVariables: Set[LogicalVariable] = variable.toSet - - override def isSingleNode = true -} - - -case class RelationshipPattern( - variable: Option[LogicalVariable], - types: Seq[RelTypeName], - length: Option[Option[Range]], - properties: Option[Expression], - direction: SemanticDirection, - legacyTypeSeparator: Boolean = false - )(val position: InputPosition) extends ASTNode { - - def isSingleLength: Boolean = length.isEmpty - - def isDirected: Boolean = direction != SemanticDirection.BOTH -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/PatternExpression.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/PatternExpression.scala deleted file mode 100644 index 82dd5250e1072..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/PatternExpression.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -case class PatternExpression(pattern: RelationshipsPattern) extends Expression { - def position = pattern.position -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/PredicateExpressions.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/PredicateExpressions.scala deleted file mode 100644 index eb9cb898f3fcb..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/PredicateExpressions.scala +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case class And(lhs: Expression, rhs: Expression)(val position: InputPosition) extends Expression with BinaryOperatorExpression { - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTBoolean, CTBoolean), outputType = CTBoolean) - ) -} - -object Ands { - def create(exprs: Set[Expression]): Expression = { - val size = exprs.size - if(size == 0) - True()(InputPosition.NONE) - else if (size == 1) - exprs.head - else - Ands(exprs)(exprs.head.position) - } -} - -case class Ands(exprs: Set[Expression])(val position: InputPosition) extends Expression with MultiOperatorExpression { - - override def canonicalOperatorSymbol = "AND" -} - -case class Or(lhs: Expression, rhs: Expression)(val position: InputPosition) extends Expression with BinaryOperatorExpression { - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTBoolean, CTBoolean), outputType = CTBoolean) - ) -} - -case class Ors(exprs: Set[Expression])(val position: InputPosition) extends Expression with MultiOperatorExpression { - override def canonicalOperatorSymbol = "OR" -} - -case class Xor(lhs: Expression, rhs: Expression)(val position: InputPosition) extends Expression with BinaryOperatorExpression { - override val signatures = Vector( - TypeSignature(Vector(CTBoolean, CTBoolean), outputType = CTBoolean) - ) -} - -case class Not(rhs: Expression)(val position: InputPosition) extends Expression with LeftUnaryOperatorExpression { - override val signatures = Vector( - TypeSignature(Vector(CTBoolean), outputType = CTBoolean) - ) -} - -case class Equals(lhs: Expression, rhs: Expression)(val position: InputPosition) extends Expression with BinaryOperatorExpression { - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTAny, CTAny), outputType = CTBoolean) - ) - - override def canonicalOperatorSymbol = "=" - - def switchSides: Equals = copy(rhs, lhs)(position) -} - -case class NotEquals(lhs: Expression, rhs: Expression)(val position: InputPosition) extends Expression with BinaryOperatorExpression { - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTAny, CTAny), outputType = CTBoolean) - ) - - override def canonicalOperatorSymbol = "<>" -} - -case class InvalidNotEquals(lhs: Expression, rhs: Expression)(val position: InputPosition) extends Expression with BinaryOperatorExpression { - override def canonicalOperatorSymbol = "!=" -} - -case class RegexMatch(lhs: Expression, rhs: Expression)(val position: InputPosition) extends Expression with BinaryOperatorExpression { - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTString, CTString), outputType = CTBoolean) - ) - - override def canonicalOperatorSymbol = "=~" -} - -case class In(lhs: Expression, rhs: Expression)(val position: InputPosition) extends Expression with BinaryOperatorExpression - -// Partial predicates are predicates that are covered by a larger predicate which is going to be solved later during planning -// (and then will replace this predicate). -// (i.e. final query graph matches up with original query) -sealed trait PartialPredicate[+P <: Expression] extends Expression { - def coveredPredicate: P - def coveringPredicate: Expression -} - -object PartialPredicate { - - def apply[P <: Expression](coveredPredicate: P, coveringPredicate: Expression): Expression = - ifNotEqual(coveredPredicate, coveringPredicate).getOrElse(coveringPredicate) - - def ifNotEqual[P <: Expression](coveredPredicate: P, coveringPredicate: Expression): Option[PartialPredicate[P]] = - if (coveredPredicate == coveringPredicate) None else Some(PartialPredicateWrapper(coveredPredicate, coveringPredicate)) - - final case class PartialPredicateWrapper[P <: Expression](coveredPredicate: P, coveringPredicate: Expression) extends PartialPredicate[P] { - override def position: InputPosition = coveredPredicate.position - } -} - -case class StartsWith(lhs: Expression, rhs: Expression)(val position: InputPosition) extends Expression with BinaryOperatorExpression { - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTString, CTString), outputType = CTBoolean) - ) -} - -case class EndsWith(lhs: Expression, rhs: Expression)(val position: InputPosition) extends Expression with BinaryOperatorExpression { - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTString, CTString), outputType = CTBoolean) - ) -} - -case class Contains(lhs: Expression, rhs: Expression)(val position: InputPosition) extends Expression with BinaryOperatorExpression { - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTString, CTString), outputType = CTBoolean) - ) -} - -case class IsNull(lhs: Expression)(val position: InputPosition) extends Expression with RightUnaryOperatorExpression { - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTAny), outputType = CTBoolean) - ) - - override def canonicalOperatorSymbol = "IS NULL" -} - -case class IsNotNull(lhs: Expression)(val position: InputPosition) extends Expression with RightUnaryOperatorExpression { - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTAny), outputType = CTBoolean) - ) - - override def canonicalOperatorSymbol = "IS NOT NULL" -} - -sealed trait InequalityExpression extends Expression with BinaryOperatorExpression { - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat, CTInteger), outputType = CTBoolean), - TypeSignature(argumentTypes = Vector(CTInteger, CTFloat), outputType = CTBoolean), - TypeSignature(argumentTypes = Vector(CTInteger, CTInteger), outputType = CTBoolean), - TypeSignature(argumentTypes = Vector(CTFloat, CTFloat), outputType = CTBoolean), - TypeSignature(argumentTypes = Vector(CTString, CTString), outputType = CTBoolean), - TypeSignature(argumentTypes = Vector(CTPoint, CTPoint), outputType = CTBoolean), - TypeSignature(argumentTypes = Vector(CTDate, CTDate), outputType = CTBoolean), - TypeSignature(argumentTypes = Vector(CTTime, CTTime), outputType = CTBoolean), - TypeSignature(argumentTypes = Vector(CTDateTime, CTDateTime), outputType = CTBoolean), - TypeSignature(argumentTypes = Vector(CTLocalTime, CTLocalTime), outputType = CTBoolean), - TypeSignature(argumentTypes = Vector(CTLocalDateTime, CTLocalDateTime), outputType = CTBoolean) - ) - - def includeEquality: Boolean - - def negated: InequalityExpression - def swapped: InequalityExpression - - def lhs: Expression - def rhs: Expression -} - -final case class LessThan(lhs: Expression, rhs: Expression)(val position: InputPosition) extends InequalityExpression { - override val canonicalOperatorSymbol = "<" - - override val includeEquality = false - - override def negated: InequalityExpression = GreaterThanOrEqual(lhs, rhs)(position) - override def swapped: InequalityExpression = GreaterThan(rhs, lhs)(position) -} - -final case class LessThanOrEqual(lhs: Expression, rhs: Expression)(val position: InputPosition) extends InequalityExpression { - override val canonicalOperatorSymbol = "<=" - - override val includeEquality = true - - override def negated: InequalityExpression = GreaterThan(lhs, rhs)(position) - override def swapped: InequalityExpression = GreaterThanOrEqual(rhs, lhs)(position) -} - -final case class GreaterThan(lhs: Expression, rhs: Expression)(val position: InputPosition) extends InequalityExpression { - override val canonicalOperatorSymbol = ">" - - override val includeEquality = false - - override def negated: InequalityExpression = LessThanOrEqual(lhs, rhs)(position) - override def swapped: InequalityExpression = LessThan(rhs, lhs)(position) -} - -final case class GreaterThanOrEqual(lhs: Expression, rhs: Expression)(val position: InputPosition) extends InequalityExpression { - override val canonicalOperatorSymbol = ">=" - - override val includeEquality = true - - override def negated: InequalityExpression = LessThan(lhs, rhs)(position) - override def swapped: InequalityExpression = LessThanOrEqual(rhs, lhs)(position) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Property.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Property.scala deleted file mode 100644 index fffb23d7cc4f9..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Property.scala +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.InputPosition - -case class Property(map: Expression, propertyKey: PropertyKeyName)(val position: InputPosition) extends LogicalProperty { - override def asCanonicalStringVal = s"${map.asCanonicalStringVal}.${propertyKey.asCanonicalStringVal}" -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Range.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Range.scala deleted file mode 100644 index d48e8b06f9f1a..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Range.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition} - -case class Range(lower: Option[UnsignedIntegerLiteral], upper: Option[UnsignedIntegerLiteral])(val position: InputPosition) extends ASTNode diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/ScopeExpression.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/ScopeExpression.scala deleted file mode 100644 index d3354e0e205f1..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/ScopeExpression.scala +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.InputPosition - -// Scope expressions bundle together variables of a new scope -// together with any child expressions that get evaluated in a context where -// these variables are bound -// -// This is a hard contract: There must be no child expressions of a scope expressions -// that are not -// - either introduced variables -// - or child expressions in a scope where those variables are bound -// -trait ScopeExpression extends Expression { - def introducedVariables: Set[LogicalVariable] -} - -case class FilterScope(variable: LogicalVariable, innerPredicate: Option[Expression])(val position: InputPosition) extends ScopeExpression { - val introducedVariables = Set(variable) -} - -case class ExtractScope(variable: LogicalVariable, innerPredicate: Option[Expression], extractExpression: Option[Expression])(val position: InputPosition) extends ScopeExpression { - val introducedVariables = Set(variable) -} - -case class ReduceScope(accumulator: LogicalVariable, variable: LogicalVariable, expression: Expression)(val position: InputPosition) extends ScopeExpression { - val introducedVariables = Set(accumulator, variable) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/SemanticDirection.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/SemanticDirection.scala deleted file mode 100644 index d418aebef5da5..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/SemanticDirection.scala +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -sealed trait SemanticDirection { - def reversed: SemanticDirection -} - -case object SemanticDirection { - case object OUTGOING extends SemanticDirection { override def reversed: SemanticDirection = INCOMING } - case object INCOMING extends SemanticDirection { override def reversed: SemanticDirection = OUTGOING } - case object BOTH extends SemanticDirection { override def reversed: SemanticDirection = BOTH } -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/ShortestPathExpression.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/ShortestPathExpression.scala deleted file mode 100644 index 682965305f4f0..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/ShortestPathExpression.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -case class ShortestPathExpression(pattern: ShortestPaths) extends Expression { - def position = pattern.position -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/SymbolicName.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/SymbolicName.scala deleted file mode 100644 index 8174351fe3260..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/SymbolicName.scala +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition} - -trait SymbolicName extends ASTNode { - def name: String - def position: InputPosition - override def asCanonicalStringVal: String = name -} - -case class Namespace(parts: List[String] = List.empty)(val position: InputPosition) extends ASTNode - -case class ProcedureName(name: String)(val position: InputPosition) extends ASTNode with SymbolicName - -case class ProcedureOutput(name: String)(val position: InputPosition) extends ASTNode with SymbolicName - -case class LabelName(name: String)(val position: InputPosition) extends SymbolicName - -case class PropertyKeyName(name: String)(val position: InputPosition) extends SymbolicName - -case class RelTypeName(name: String)(val position: InputPosition) extends SymbolicName diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/TypeSignature.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/TypeSignature.scala deleted file mode 100644 index c3059ad822ee3..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/TypeSignature.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.symbols.CypherType - -case class TypeSignature(argumentTypes: IndexedSeq[CypherType], outputType: CypherType) diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/TypeSignatures.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/TypeSignatures.scala deleted file mode 100644 index 28b833e6054f9..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/TypeSignatures.scala +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -trait TypeSignatures { - - def signatures: Seq[TypeSignature] = Seq.empty - - lazy val signatureLengths: Seq[Int] = signatures.map(_.argumentTypes.length) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Variable.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Variable.scala deleted file mode 100644 index 8b98201585c6e..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/Variable.scala +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.InputPosition - -case class Variable(name: String)(val position: InputPosition) extends LogicalVariable { - - override def copyId = copy()(position) - - override def renameId(newName: String) = copy(name = newName)(position) - - override def bumpId = copy()(position.bumped()) - - override def asCanonicalStringVal: String = name -} - -object Variable { - implicit val byName: Ordering[Variable] = - Ordering.by { (variable: Variable) => - (variable.name, variable.position) - }(Ordering.Tuple2(implicitly[Ordering[String]], InputPosition.byOffset)) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/containsAggregate.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/containsAggregate.scala deleted file mode 100644 index 7ea45b2fb2630..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/expressions/containsAggregate.scala +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -object containsAggregate extends (Expression => Boolean) { - def apply(expr: Expression) = { - expr.treeFold[Boolean](false) { - case IsAggregate(_) => acc => (true, None) - } - } -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Abs.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Abs.scala deleted file mode 100644 index c1468a1b667f3..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Abs.scala +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Abs extends Function with TypeSignatures { - def name = "abs" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTInteger), outputType = CTInteger), - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Acos.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Acos.scala deleted file mode 100644 index 07011de42c814..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Acos.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Acos extends Function with TypeSignatures { - def name = "acos" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Asin.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Asin.scala deleted file mode 100644 index 9c3c0a3c1f25c..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Asin.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Asin extends Function with TypeSignatures { - def name = "asin" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Atan.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Atan.scala deleted file mode 100644 index cfa85949e612b..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Atan.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Atan extends Function with TypeSignatures { - def name = "atan" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Atan2.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Atan2.scala deleted file mode 100644 index 7847551d6fcef..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Atan2.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Atan2 extends Function with TypeSignatures { - def name = "atan2" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat, CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Avg.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Avg.scala deleted file mode 100644 index 5a95ef3bb6ca4..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Avg.scala +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Avg extends AggregatingFunction with TypeSignatures { - def name = "avg" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTInteger), outputType = CTInteger), - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Ceil.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Ceil.scala deleted file mode 100644 index 75a11f46d9e5b..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Ceil.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Ceil extends Function with TypeSignatures { - def name = "ceil" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Coalesce.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Coalesce.scala deleted file mode 100644 index 6cad6fec05c04..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Coalesce.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -case object Coalesce extends Function { - def name = "coalesce" -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Collect.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Collect.scala deleted file mode 100644 index 9720b4a8ad277..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Collect.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -case object Collect extends AggregatingFunction { - def name = "collect" -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Cos.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Cos.scala deleted file mode 100644 index e6b4158eebc21..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Cos.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Cos extends Function with TypeSignatures { - def name = "cos" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Cot.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Cot.scala deleted file mode 100644 index bf0b47fe8f987..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Cot.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Cot extends Function with TypeSignatures { - def name = "cot" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Count.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Count.scala deleted file mode 100644 index d52bb3dfc7003..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Count.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Count extends AggregatingFunction with TypeSignatures { - def name = "count" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTAny), outputType = CTInteger) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Degrees.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Degrees.scala deleted file mode 100644 index b908448db221f..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Degrees.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Degrees extends Function with TypeSignatures { - def name = "degrees" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Distance.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Distance.scala deleted file mode 100644 index c7d67c6e0bc40..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Distance.scala +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Distance extends Function with TypeSignatures { - def name = "distance" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTGeometry, CTGeometry), outputType = CTFloat), - TypeSignature(argumentTypes = Vector(CTPoint, CTGeometry), outputType = CTFloat), - TypeSignature(argumentTypes = Vector(CTGeometry, CTPoint), outputType = CTFloat), - TypeSignature(argumentTypes = Vector(CTPoint, CTPoint), outputType = CTFloat), - // Will return null: - TypeSignature(argumentTypes = Vector(CTAny, CTAny), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/E.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/E.scala deleted file mode 100644 index efa466e79f82a..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/E.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object E extends Function with TypeSignatures { - def name = "e" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/EndNode.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/EndNode.scala deleted file mode 100644 index 589bc9412ea79..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/EndNode.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object EndNode extends Function with TypeSignatures { - def name = "endNode" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTRelationship), outputType = CTNode) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Exists.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Exists.scala deleted file mode 100644 index 7ac58b65fc67e..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Exists.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -case object Exists extends Function { - def name = "EXISTS" -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Exp.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Exp.scala deleted file mode 100644 index f5f093a7e5d6c..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Exp.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Exp extends Function with TypeSignatures { - def name = "exp" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Floor.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Floor.scala deleted file mode 100644 index 2ccceecef6e04..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Floor.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Floor extends Function with TypeSignatures { - def name = "floor" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Function.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Function.scala deleted file mode 100644 index 4f59d4be273d6..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Function.scala +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, FunctionInvocation, FunctionName} - -object Function { - private val knownFunctions: Seq[Function] = Vector( - Abs, - Acos, - Asin, - Atan, - Atan2, - Avg, - Ceil, - Coalesce, - Collect, - Ceil, - Cos, - Cot, - Count, - Degrees, - Distance, - E, - EndNode, - Exists, - Exp, - Floor, - Haversin, - Head, - Id, - Labels, - Last, - Left, - Length, - Log, - Log10, - LTrim, - Max, - Min, - Nodes, - Pi, - PercentileCont, - PercentileDisc, - Point, - Keys, - Radians, - Rand, - Range, - Reduce, - Relationships, - Replace, - Reverse, - Right, - Round, - RTrim, - Sign, - Sin, - Size, - Sqrt, - Split, - StartNode, - StdDev, - StdDevP, - Substring, - Sum, - Tail, - Tan, - Timestamp, - ToBoolean, - ToFloat, - ToInteger, - ToLower, - ToString, - ToUpper, - Properties, - Trim, - Type - ) - - val lookup: Map[String, Function] = knownFunctions.map { f => (f.name.toLowerCase, f) }.toMap -} - -abstract class Function { - def name: String - - def asFunctionName(implicit position: InputPosition): FunctionName = FunctionName(name)(position) - - def asInvocation(argument: Expression, distinct: Boolean = false)(implicit position: InputPosition): FunctionInvocation = - FunctionInvocation(asFunctionName, distinct = distinct, IndexedSeq(argument))(position) - - def asInvocation(lhs: Expression, rhs: Expression)(implicit position: InputPosition): FunctionInvocation = - FunctionInvocation(asFunctionName, distinct = false, IndexedSeq(lhs, rhs))(position) -} - -abstract class AggregatingFunction extends Function diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Haversin.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Haversin.scala deleted file mode 100644 index 8acaa10c8e4dc..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Haversin.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Haversin extends Function with TypeSignatures { - def name = "haversin" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Head.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Head.scala deleted file mode 100644 index a75ef336004f7..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Head.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -case object Head extends Function { - def name = "head" -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Id.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Id.scala deleted file mode 100644 index c066b25b6ef44..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Id.scala +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Id extends Function with TypeSignatures { - def name = "id" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTNode), outputType = CTInteger), - TypeSignature(argumentTypes = Vector(CTRelationship), outputType = CTInteger) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Keys.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Keys.scala deleted file mode 100644 index 0a16255bc5520..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Keys.scala +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Keys extends Function with TypeSignatures { - def name = "keys" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTNode), outputType = CTList(CTString)), - TypeSignature(argumentTypes = Vector(CTRelationship), outputType = CTList(CTString)), - TypeSignature(argumentTypes = Vector(CTMap), outputType = CTList(CTString)) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/LTrim.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/LTrim.scala deleted file mode 100644 index a6df600055ab5..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/LTrim.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object LTrim extends Function with TypeSignatures { - def name = "ltrim" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTString), outputType = CTString) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Labels.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Labels.scala deleted file mode 100644 index 970ef748ce7fc..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Labels.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Labels extends Function with TypeSignatures { - override def name = "labels" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTNode), outputType = CTList(CTString)) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Last.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Last.scala deleted file mode 100644 index 8dbedea52c342..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Last.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -case object Last extends Function { - def name = "last" -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Left.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Left.scala deleted file mode 100644 index 6252ce5073c11..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Left.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Left extends Function with TypeSignatures { - def name = "left" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTString, CTInteger), outputType = CTString) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Length.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Length.scala deleted file mode 100644 index 2d9bed852833b..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Length.scala +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Length extends Function with TypeSignatures { - def name = "length" - - //NOTE using CTString and CTCollection here is deprecated - override val signatures = Vector( - TypeSignature(Vector(CTString), CTInteger), - TypeSignature(Vector(CTList(CTAny)), CTInteger), - TypeSignature(Vector(CTPath), CTInteger) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Log.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Log.scala deleted file mode 100644 index 58d518deda982..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Log.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Log extends Function with TypeSignatures { - def name = "log" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Log10.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Log10.scala deleted file mode 100644 index 5a5b76eb87ed2..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Log10.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Log10 extends Function with TypeSignatures { - def name = "log10" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Max.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Max.scala deleted file mode 100644 index 4236819641471..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Max.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -case object Max extends AggregatingFunction { - override def name = "max" -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Min.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Min.scala deleted file mode 100644 index 06f7d197eca93..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Min.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -case object Min extends AggregatingFunction { - override def name = "min" -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Nodes.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Nodes.scala deleted file mode 100644 index 1543fffd9a904..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Nodes.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Nodes extends Function with TypeSignatures { - def name = "nodes" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTPath), outputType = CTList(CTNode)) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/PercentileCont.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/PercentileCont.scala deleted file mode 100644 index e68342f4bc16d..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/PercentileCont.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object PercentileCont extends AggregatingFunction with TypeSignatures { - def name = "percentileCont" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat, CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/PercentileDisc.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/PercentileDisc.scala deleted file mode 100644 index eb56142e6cf36..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/PercentileDisc.scala +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object PercentileDisc extends AggregatingFunction with TypeSignatures { - def name = "percentileDisc" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTInteger, CTFloat), outputType = CTInteger), - TypeSignature(argumentTypes = Vector(CTFloat, CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Pi.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Pi.scala deleted file mode 100644 index eb51c466efe2d..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Pi.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Pi extends Function with TypeSignatures { - def name = "pi" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Point.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Point.scala deleted file mode 100644 index 2f6108e1311fa..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Point.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Point extends Function with TypeSignatures { - override def name = "point" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTMap), outputType = CTPoint) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Properties.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Properties.scala deleted file mode 100644 index d40425285d39c..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Properties.scala +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object Properties extends Function with TypeSignatures { - override def name = "properties" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTNode), outputType = CTMap), - TypeSignature(argumentTypes = Vector(CTRelationship), outputType = CTMap), - TypeSignature(argumentTypes = Vector(CTMap), outputType = CTMap) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/RTrim.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/RTrim.scala deleted file mode 100644 index 9d96e290de6db..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/RTrim.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object RTrim extends Function with TypeSignatures { - def name = "rtrim" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTString), outputType = CTString) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Radians.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Radians.scala deleted file mode 100644 index 0bd16ea76b083..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Radians.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Radians extends Function with TypeSignatures { - def name = "radians" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Rand.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Rand.scala deleted file mode 100644 index 496001be25fe0..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Rand.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object Rand extends Function with TypeSignatures { - val name = "rand" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Range.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Range.scala deleted file mode 100644 index 2a85cf9dc3cca..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Range.scala +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object Range extends Function with TypeSignatures { - def name = "range" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTInteger, CTInteger), outputType = CTList(CTInteger)), - TypeSignature(argumentTypes = Vector(CTInteger, CTInteger, CTInteger), outputType = CTList(CTInteger)) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Reduce.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Reduce.scala deleted file mode 100644 index e52dce023b3bf..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Reduce.scala +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -// this implementation exists only to handle the case where "reduce(x = 0, x in y : foo)" is parsed as a function invocation, -// rather than a ReduceExpression -case object Reduce extends Function { - def name = "reduce" -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Relationships.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Relationships.scala deleted file mode 100644 index 9b9f72f9f3443..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Relationships.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object Relationships extends Function with TypeSignatures { - def name = "relationships" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTPath), outputType = CTList(CTRelationship)) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Replace.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Replace.scala deleted file mode 100644 index fe20aa7883583..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Replace.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object Replace extends Function with TypeSignatures { - def name = "replace" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTString, CTString, CTString), outputType = CTString) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Reverse.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Reverse.scala deleted file mode 100644 index 0ed6b6b0b7c77..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Reverse.scala +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object Reverse extends Function with TypeSignatures { - def name = "reverse" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTString), outputType = CTString), - TypeSignature(argumentTypes = Vector(CTList(CTAny)), outputType = CTList(CTAny)) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Right.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Right.scala deleted file mode 100644 index 194bcae0f6900..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Right.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object Right extends Function with TypeSignatures { - def name = "right" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTString, CTInteger), outputType = CTString) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Round.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Round.scala deleted file mode 100644 index 1939f156de5e6..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Round.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object Round extends Function with TypeSignatures { - def name = "round" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Sign.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Sign.scala deleted file mode 100644 index 648ded3d99044..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Sign.scala +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object Sign extends Function with TypeSignatures { - def name = "sign" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTInteger), outputType = CTInteger), - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTInteger) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Sin.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Sin.scala deleted file mode 100644 index c965af873cc81..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Sin.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object Sin extends Function with TypeSignatures { - def name = "sin" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Size.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Size.scala deleted file mode 100644 index 52503d27e9348..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Size.scala +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object Size extends Function with TypeSignatures { - def name = "size" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTList(CTAny)), outputType = CTInteger), - TypeSignature(argumentTypes = Vector(CTString), outputType = CTInteger) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Split.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Split.scala deleted file mode 100644 index 3e0e4d5e0ae5c..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Split.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object Split extends Function with TypeSignatures { - def name = "split" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTString, CTString), outputType = CTList(CTString)) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Sqrt.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Sqrt.scala deleted file mode 100644 index ff3004e422b23..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Sqrt.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object Sqrt extends Function with TypeSignatures { - def name = "sqrt" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/StartNode.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/StartNode.scala deleted file mode 100644 index 9678b1c909537..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/StartNode.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object StartNode extends Function with TypeSignatures { - def name = "startNode" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTRelationship), outputType = CTNode) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/StdDev.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/StdDev.scala deleted file mode 100644 index de7a3bc23e511..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/StdDev.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object StdDev extends AggregatingFunction with TypeSignatures { - def name = "stdev" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/StdDevP.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/StdDevP.scala deleted file mode 100644 index 99aeee7e4bef4..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/StdDevP.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object StdDevP extends AggregatingFunction with TypeSignatures { - def name = "stdevp" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Substring.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Substring.scala deleted file mode 100644 index 26e9c6fb76185..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Substring.scala +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object Substring extends Function with TypeSignatures { - def name = "substring" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTString, CTInteger), outputType = CTString), - TypeSignature(argumentTypes = Vector(CTString, CTInteger, CTInteger), outputType = CTString) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Sum.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Sum.scala deleted file mode 100644 index 7fa4123cec718..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Sum.scala +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} - -case object Sum extends AggregatingFunction with TypeSignatures { - def name = "sum" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTInteger), outputType = CTInteger), - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Tail.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Tail.scala deleted file mode 100644 index 67a66cc192065..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Tail.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -case object Tail extends Function { - def name = "tail" -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Tan.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Tan.scala deleted file mode 100644 index 61db83a48068f..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Tan.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object Tan extends Function with TypeSignatures { - def name = "tan" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Timestamp.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Timestamp.scala deleted file mode 100644 index bb399b9fa9e01..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Timestamp.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object Timestamp extends Function with TypeSignatures { - val name = "timestamp" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(), outputType = CTInteger) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToBoolean.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToBoolean.scala deleted file mode 100644 index ddfb4de718731..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToBoolean.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -case object ToBoolean extends Function { - def name = "toBoolean" -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToFloat.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToFloat.scala deleted file mode 100644 index 61b723cd9ef76..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToFloat.scala +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object ToFloat extends Function with TypeSignatures { - override def name = "toFloat" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTString), outputType = CTFloat), - TypeSignature(argumentTypes = Vector(CTNumber), outputType = CTFloat) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToInteger.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToInteger.scala deleted file mode 100644 index e56fe76bc6dd4..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToInteger.scala +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object ToInteger extends Function with TypeSignatures { - override def name = "toInteger" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTString), outputType = CTInteger), - TypeSignature(argumentTypes = Vector(CTNumber), outputType = CTInteger) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToLower.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToLower.scala deleted file mode 100644 index 0c5a78d49a4f5..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToLower.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object ToLower extends Function with TypeSignatures { - def name = "ToLower" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTString), outputType = CTString) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToString.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToString.scala deleted file mode 100644 index 3094fe94ba9ce..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToString.scala +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object ToString extends Function with TypeSignatures { - override def name = "toString" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTString), - TypeSignature(argumentTypes = Vector(CTInteger), outputType = CTString), - TypeSignature(argumentTypes = Vector(CTBoolean), outputType = CTString), - TypeSignature(argumentTypes = Vector(CTString), outputType = CTString), - TypeSignature(argumentTypes = Vector(CTDuration), outputType = CTString), - TypeSignature(argumentTypes = Vector(CTDate), outputType = CTString), - TypeSignature(argumentTypes = Vector(CTTime), outputType = CTString), - TypeSignature(argumentTypes = Vector(CTDateTime), outputType = CTString), - TypeSignature(argumentTypes = Vector(CTLocalTime), outputType = CTString), - TypeSignature(argumentTypes = Vector(CTLocalDateTime), outputType = CTString), - TypeSignature(argumentTypes = Vector(CTPoint), outputType = CTString) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToUpper.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToUpper.scala deleted file mode 100644 index c46072a0bde3d..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/ToUpper.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object ToUpper extends Function with TypeSignatures { - def name = "toUpper" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTString), outputType = CTString) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Trim.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Trim.scala deleted file mode 100644 index bab0ea764ee93..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Trim.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object Trim extends Function with TypeSignatures { - def name = "trim" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTString), outputType = CTString) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Type.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Type.scala deleted file mode 100644 index cab887f6a87d9..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/Type.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -import org.neo4j.cypher.internal.v3_5.expressions.{TypeSignature, TypeSignatures} -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -case object Type extends Function with TypeSignatures { - override def name = "type" - - override val signatures = Vector( - TypeSignature(argumentTypes = Vector(CTRelationship), outputType = CTString) - ) -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/UnresolvedFunction.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/UnresolvedFunction.scala deleted file mode 100644 index c8ab8dfa60cfb..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/UnresolvedFunction.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -case object UnresolvedFunction extends Function { - def name = "UNKNOWN" -} diff --git a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/UserDefinedFunctionInvocation.scala b/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/UserDefinedFunctionInvocation.scala deleted file mode 100644 index 3e37f0e4ff8e0..0000000000000 --- a/community/cypher/expressions-3.5/src/main/scala/org/neo4j/cypher/internal/v3_5/functions/UserDefinedFunctionInvocation.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.functions - -trait UserDefinedFunctionInvocation { - def isAggregate:Boolean -} diff --git a/community/cypher/expressions-3.5/src/test/scala/org/neo4j/cypher/internal/v3_5/expressions/DummyExpression.scala b/community/cypher/expressions-3.5/src/test/scala/org/neo4j/cypher/internal/v3_5/expressions/DummyExpression.scala deleted file mode 100644 index 86ae5d8c2eabb..0000000000000 --- a/community/cypher/expressions-3.5/src/test/scala/org/neo4j/cypher/internal/v3_5/expressions/DummyExpression.scala +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.v3_5.expressions - -import org.neo4j.cypher.internal.util.v3_5.symbols.TypeSpec -import org.neo4j.cypher.internal.util.v3_5.{DummyPosition, InputPosition} - -case class DummyExpression( - possibleTypes: TypeSpec, - position: InputPosition = DummyPosition(0) - ) extends Expression diff --git a/community/cypher/frontend-3.5/ASL-2-header.txt b/community/cypher/frontend-3.5/ASL-2-header.txt deleted file mode 100644 index f1f80695adcd5..0000000000000 --- a/community/cypher/frontend-3.5/ASL-2-header.txt +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (c) ${inceptionYear}-${currentYear} "Neo Technology," -Network Engine for Objects in Lund AB [http://neotechnology.com] - -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. diff --git a/community/cypher/frontend-3.5/LICENSES.txt b/community/cypher/frontend-3.5/LICENSES.txt deleted file mode 100644 index 3689438757721..0000000000000 --- a/community/cypher/frontend-3.5/LICENSES.txt +++ /dev/null @@ -1,291 +0,0 @@ -This file contains the full license text of the included third party -libraries. For an overview of the licenses see the NOTICE.txt file. - - ------------------------------------------------------------------------------- -Apache Software License, Version 2.0 - Apache Commons Lang - parboiled-core - parboiled-scala ------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. - - - ------------------------------------------------------------------------------- -BSD - Scala License - Scala Library ------------------------------------------------------------------------------- - -SCALA LICENSE - -Copyright (c) 2002-2012 EPFL, Lausanne, unless otherwise specified. -All rights reserved. - -This software was developed by the Programming Methods Laboratory of the -Swiss Federal Institute of Technology (EPFL), Lausanne, Switzerland. - -Permission to use, copy, modify, and distribute this software in source -or binary form for any purpose with or without fee is hereby granted, -provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the EPFL nor the names of its contributors - may be used to endorse or promote products derived from this - software without specific prior written permission. - - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - - - ------------------------------------------------------------------------------- -BSD License - Scala Compiler ------------------------------------------------------------------------------- - -Copyright (c) , -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - - diff --git a/community/cypher/frontend-3.5/NOTICE.txt b/community/cypher/frontend-3.5/NOTICE.txt deleted file mode 100644 index 2303e16bccab4..0000000000000 --- a/community/cypher/frontend-3.5/NOTICE.txt +++ /dev/null @@ -1,29 +0,0 @@ -Copyright (c) 2002-2018, "Neo Technology," -Network Engine for Objects in Lund AB [http://neotechnology.com] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. - -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. - -Full license texts are found in LICENSES.txt. - - -Third-party licenses --------------------- - -Apache Software License, Version 2.0 - Apache Commons Lang - parboiled-core - parboiled-scala - -BSD - Scala License - Scala Library - -BSD License - Scala Compiler - diff --git a/community/cypher/frontend-3.5/pom.xml b/community/cypher/frontend-3.5/pom.xml deleted file mode 100644 index 2972b233828e3..0000000000000 --- a/community/cypher/frontend-3.5/pom.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - - org.neo4j - cypher-parent - 3.5.0-SNAPSHOT - ../ - - - 4.0.0 - openCypher-frontend-1 - jar - 3.5.0-SNAPSHOT - openCypher Frontend - - - Scala implementation of - - parser - - abstract syntax tree (AST) - - semantic analysis - - typing - - scoping - - for openCypher queries, resulting in a normalised AST representation of the query string. - - See https://www.opencypher.org for more information on the openCypher project and query language. - - - http://components.neo4j.org/${project.artifactId}/${project.version} - - - scm:git:git://github.com/neo4j/neo4j.git - scm:git:git@github.com:neo4j/neo4j.git - https://github.com/neo4j/neo4j - - - - notice-asl-prefix.txt - ${project.baseUri}/ASL-2-header.txt - org.neo4j.cypher.internal.frontend.v3_5 - - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - - - - - - - org.scalastyle - scalastyle-maven-plugin - - - - - - - - - - - - org.neo4j - neo4j-cypher-util-3.5 - ${project.version} - - - - org.neo4j - neo4j-cypher-expression-3.5 - ${project.version} - - - - - - org.neo4j - neo4j-cypher-util-3.5 - ${project.version} - test-jar - test - - - - org.neo4j - neo4j-cypher-expression-3.5 - ${project.version} - test-jar - test - - - - - - org.scala-lang - scala-library - - - - org.scala-lang - scala-reflect - - - - - - org.scalatest - scalatest_2.11 - - - org.scalacheck - scalacheck_2.11 - - - - - - org.parboiled - parboiled-scala_2.11 - - - - org.apache.commons - commons-lang3 - - - - - diff --git a/community/cypher/frontend-3.5/src/main/java/org/neo4j/cypher/internal/frontend/v3_5/phases/CompilationPhaseTracer.java b/community/cypher/frontend-3.5/src/main/java/org/neo4j/cypher/internal/frontend/v3_5/phases/CompilationPhaseTracer.java deleted file mode 100644 index 54898bd45293f..0000000000000 --- a/community/cypher/frontend-3.5/src/main/java/org/neo4j/cypher/internal/frontend/v3_5/phases/CompilationPhaseTracer.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.phases; - -public interface CompilationPhaseTracer -{ - enum CompilationPhase - { - PARSING, - DEPRECATION_WARNINGS, - SEMANTIC_CHECK, - AST_REWRITE, - LOGICAL_PLANNING, - CODE_GENERATION, - PIPE_BUILDING, - } - - CompilationPhaseEvent beginPhase( CompilationPhase phase ); - - interface CompilationPhaseEvent extends AutoCloseable - { - @Override - void close(); - } - - CompilationPhaseTracer NO_TRACING = new CompilationPhaseTracer() - { - @Override - public CompilationPhaseEvent beginPhase( CompilationPhase phase ) - { - return NONE_PHASE; - } - }; - - CompilationPhaseEvent NONE_PHASE = () -> - { - }; -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/AstRewritingMonitor.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/AstRewritingMonitor.scala deleted file mode 100644 index 5a1518e04744f..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/AstRewritingMonitor.scala +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5 - -trait AstRewritingMonitor { - def abortedRewriting(obj: AnyRef) - def abortedRewritingDueToLargeDNF(obj: AnyRef) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/IdentityMap.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/IdentityMap.scala deleted file mode 100644 index 139e65b1ac8ce..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/IdentityMap.scala +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5 - -import java.util - -import scala.collection.JavaConverters._ -import scala.collection.immutable.Map - -object IdentityMap { - def empty[K, V]: IdentityMap[K, V] = IdentityMap() - - def apply[K, V](elems: (K, V)*): IdentityMap[K, V] = { - val idMap = new util.IdentityHashMap[K, V]() - elems.foreach { - elem => idMap.put(elem._1, elem._2) - } - IdentityMap(idMap) - } -} - -case class IdentityMap[K, V] private (idMap: util.IdentityHashMap[K, V] = new util.IdentityHashMap[K, V]()) extends Map[K, V] { - self => - - override def get(key: K): Option[V] = - idMap.get(key) match { - case null => None - case value => Some(value) - } - - override def +[V1 >: V](kv: (K, V1)): IdentityMap[K, V1] = - IdentityMap({ - val clone = idMap.clone().asInstanceOf[util.IdentityHashMap[K, V1]] - clone.put(kv._1, kv._2) - clone - }) - - override def -(key: K): IdentityMap[K, V] = - IdentityMap({ - val clone = idMap.clone().asInstanceOf[util.IdentityHashMap[K, V]] - clone.remove(key) - clone - }) - - override def updated[V1 >: V](key: K, value: V1): IdentityMap[K, V1] = this + ((key, value)) - - override def iterator: Iterator[(K, V)] = - idMap.clone().asInstanceOf[util.IdentityHashMap[K, V]].entrySet().iterator().asScala.map(e => (e.getKey, e.getValue)) - - override def stringPrefix: String = "IdentityMap" -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/PlannerName.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/PlannerName.scala deleted file mode 100644 index 877c3498a3ead..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/PlannerName.scala +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5 - -/** - * This class defines the query planners used by cyphers. - **/ -trait PlannerName { - def name: String - def toTextOutput: String - def version: String -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ScopeTreeVerifier.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ScopeTreeVerifier.scala deleted file mode 100644 index 4ea66836ba8ab..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ScopeTreeVerifier.scala +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5 - -import org.neo4j.cypher.internal.util.v3_5.Ref -import org.neo4j.cypher.internal.frontend.v3_5.semantics.Scope - -import scala.compat.Platform.EOL - -object ScopeTreeVerifier { - def verify(root: Scope): Seq[String] = { - val localSymbolTableIssues = root.allScopes.flatMap { - scope => - scope.symbolTable.collect { - case (name, symbol) if name != symbol.name => - s"'$name' points to symbol with different name '$symbol' in scope #${Ref(scope).toIdString}. Scope tree:$EOL$root" - } - } - localSymbolTableIssues - } - -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ASTAnnotationMap.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ASTAnnotationMap.scala deleted file mode 100644 index bb57e61f3161a..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ASTAnnotationMap.scala +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, Eagerly, InputPosition} - -object ASTAnnotationMap { - def empty[K <: ASTNode, V]: ASTAnnotationMap[K, V] = new ASTAnnotationMap(Map.empty[(K, InputPosition), V]) - def apply[K <: ASTNode, V](elems: (K, V)*): ASTAnnotationMap[K, V] = - new ASTAnnotationMap[K, V](Map(elems.map { case (astnode, value) => ((astnode, astnode.position), value)}: _*)) -} - -class ASTAnnotationMap[K <: ASTNode, V] private (store: Map[(K, InputPosition), V]) extends Map[K, V] { - - def keyPositionSet: Set[(K, InputPosition)] = store.keySet - - override def +[B1 >: V](kv: (K, B1)): ASTAnnotationMap[K, B1] = - new ASTAnnotationMap(store + (((kv._1, kv._1.position), kv._2))) - - override def get(key: K): Option[V] = - store.get((key, key.position)) - - override def updated[V1 >: V](key: K, value: V1): ASTAnnotationMap[K, V1] = - this + ((key, value)) - - override def iterator: Iterator[(K, V)] = - store.iterator.map { case ((astNode, _), value) => (astNode, value) } - - override def -(key: K): Map[K, V] = - new ASTAnnotationMap(store - ((key, key.position))) - - override def mapValues[C](f: (V) => C): ASTAnnotationMap[K, C] = - new ASTAnnotationMap(Eagerly.immutableMapValues(store, f)) - - def replaceKeys(replacements: (K, K)*) = { - val expandedReplacements = replacements.map { - case (oldKey, newKey) => (oldKey -> oldKey.position) -> (newKey -> newKey.position) - } - val newStore = Eagerly.immutableReplaceKeys(store)(expandedReplacements: _*) - new ASTAnnotationMap(newStore) - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ASTSlicingPhrase.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ASTSlicingPhrase.scala deleted file mode 100644 index 8e43d9f085a4a..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ASTSlicingPhrase.scala +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.ASTNode -import org.neo4j.cypher.internal.frontend.v3_5.semantics._ -import org.neo4j.cypher.internal.util.v3_5.symbols.CTInteger -import org.neo4j.cypher.internal.frontend.v3_5.SemanticCheck -import org.neo4j.cypher.internal.v3_5.expressions._ - -// Skip/Limit -trait ASTSlicingPhrase extends SemanticCheckable with SemanticAnalysisTooling { - self: ASTNode => - def name: String - def dependencies: Set[LogicalVariable] = expression.dependencies - def expression: Expression - - def semanticCheck: SemanticCheck = - containsNoVariables chain - literalShouldBeUnsignedInteger chain - SemanticExpressionCheck.simple(expression) chain - expectType(CTInteger.covariant, expression) - - private def containsNoVariables: SemanticCheck = { - val deps = dependencies - if (deps.nonEmpty) { - val id = deps.toSeq.minBy(_.position) - error(s"It is not allowed to refer to variables in $name", id.position) - } - else SemanticCheckResult.success - } - - private def literalShouldBeUnsignedInteger: SemanticCheck = { - try { - expression match { - case _: UnsignedDecimalIntegerLiteral => SemanticCheckResult.success - case i: SignedDecimalIntegerLiteral if i.value >= 0 => SemanticCheckResult.success - case lit: Literal => error(s"Invalid input '${lit.asCanonicalStringVal}' is not a valid value, " + - "must be a positive integer", lit.position) - case _ => SemanticCheckResult.success - } - } catch { - case nfe: NumberFormatException => SemanticError("Invalid input for " + name + - ". Either the string does not have the appropriate format or the provided number is bigger then 2^63-1", expression.position) - } - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Clause.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Clause.scala deleted file mode 100644 index fe9a2e85c64d9..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Clause.scala +++ /dev/null @@ -1,652 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.Foldable._ -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition, InternalException} -import org.neo4j.cypher.internal.frontend.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.helpers.StringHelper.RichString -import org.neo4j.cypher.internal.frontend.v3_5.notification.{CartesianProductNotification, DeprecatedStartNotification} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticCheckResult._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics._ -import org.neo4j.cypher.internal.v3_5.expressions.Expression.SemanticContext -import org.neo4j.cypher.internal.v3_5.expressions._ -import org.neo4j.cypher.internal.v3_5.functions - -sealed trait Clause extends ASTNode with SemanticCheckable { - def name: String - - def returnColumns: List[String] = - throw new InternalException("This clause is not allowed as a last clause and hence does not declare return columns") -} - -sealed trait UpdateClause extends Clause with SemanticAnalysisTooling { - override def returnColumns: List[String] = List.empty -} - -case class LoadCSV( - withHeaders: Boolean, - urlString: Expression, - variable: Variable, - fieldTerminator: Option[StringLiteral] - )(val position: InputPosition) extends Clause with SemanticAnalysisTooling { - override def name: String = "LOAD CSV" - - override def semanticCheck: SemanticCheck = - SemanticExpressionCheck.simple(urlString) chain - expectType(CTString.covariant, urlString) chain - checkFieldTerminator chain - typeCheck - - private def checkFieldTerminator: SemanticCheck = { - fieldTerminator match { - case Some(literal) if literal.value.length != 1 => - error("CSV field terminator can only be one character wide", literal.position) - case _ => SemanticCheckResult.success - } - } - - private def typeCheck: SemanticCheck = { - val typ = if (withHeaders) - CTMap - else - CTList(CTString) - - declareVariable(variable, typ) - } -} - -sealed trait MultipleGraphClause extends Clause with SemanticAnalysisTooling { - - override def semanticCheck: SemanticCheck = - requireMultigraphSupport(s"The `$name` clause", position) -} - -sealed trait CreateGraphClause extends MultipleGraphClause with UpdateClause { - def snapshot: Boolean - def graph: Variable - def at: GraphUrl - def of: Option[Pattern] - - override def name = "CREATE GRAPH" - - override def semanticCheck: SemanticCheck = - super.semanticCheck chain - declareGraph(graph) chain - of.fold(SemanticCheckResult.success)(SemanticPatternCheck.check(Pattern.SemanticContext.Create, _)) -} - -final case class CreateRegularGraph(snapshot: Boolean, graph: Variable, of: Option[Pattern], at: GraphUrl)(val position: InputPosition) - extends CreateGraphClause { - - override def semanticCheck: SemanticCheck = - super.semanticCheck chain - SemanticState.recordCurrentScope(this) -} - -final case class CreateNewSourceGraph(snapshot: Boolean, graph: Variable, of: Option[Pattern], at: GraphUrl)(val position: InputPosition) - extends CreateGraphClause { - - override def semanticCheck: SemanticCheck = error("Clause not rewritten as expected (see PreparatoryRewriting)", position) - -} - -final case class CreateNewTargetGraph(snapshot: Boolean, graph: Variable, of: Option[Pattern], at: GraphUrl)(val position: InputPosition) - extends CreateGraphClause { - - override def semanticCheck: SemanticCheck = error("Clause not rewritten as expected (see PreparatoryRewriting)", position) -} - -final case class DeleteGraphs(graphs: Seq[Variable])(val position: InputPosition) - extends MultipleGraphClause with UpdateClause{ - - override def name = "DELETE GRAPHS" - - override def semanticCheck: SemanticCheck = - super.semanticCheck chain - SemanticExpressionCheck.semanticCheckFold(graphs)(SemanticExpressionCheck.ensureGraphDefined) chain - SemanticState.recordCurrentScope(this) -} - -final case class Persist(graph: BoundGraphAs, to: GraphUrl)(val position: InputPosition) - extends MultipleGraphClause with UpdateClause { - - override def name = "PERSIST" - - override def semanticCheck: SemanticCheck = - super.semanticCheck chain - graph.semanticCheck chain - SemanticState.recordCurrentScope(this) -} - -final case class Snapshot(graph: BoundGraphAs, to: GraphUrl)(val position: InputPosition) - extends MultipleGraphClause with UpdateClause { - - override def name = "SNAPSHOT" - - override def semanticCheck: SemanticCheck = - super.semanticCheck chain - graph.semanticCheck chain - SemanticState.recordCurrentScope(this) -} - -final case class Relocate(graph: BoundGraphAs, to: GraphUrl)(val position: InputPosition) - extends MultipleGraphClause with UpdateClause { - - override def name = "RELOCATE" - - override def semanticCheck: SemanticCheck = - super.semanticCheck chain - graph.semanticCheck chain - SemanticState.recordCurrentScope(this) -} - -case class Start(items: Seq[StartItem], where: Option[Where])(val position: InputPosition) extends Clause { - override def name = "START" - - override def semanticCheck: SemanticCheck = (state: SemanticState) => { - - val query = rewrittenQuery - val newState = state.addNotification(DeprecatedStartNotification(position, query)) - SemanticCheckResult(newState, Seq(SemanticError( - s"""START is deprecated, use: `$query` instead. - """.stripMargin, position))) - } - - private def rewrittenQuery: String = { - val rewritten = items.map { - case NodeByIdentifiedIndex(variable, index, key, expression) => - s"CALL db.index.explicit.seekNodes('$index', '$key', '${expression.asCanonicalStringVal}') YIELD node AS ${variable.asCanonicalStringVal}" - case NodeByIndexQuery(variable, index, expression) => - s"CALL db.index.explicit.searchNodes('$index', '${expression.asCanonicalStringVal}') YIELD node AS ${variable.asCanonicalStringVal}" - case RelationshipByIdentifiedIndex(variable, index, key, expression) => - s"CALL db.index.explicit.seekRelationships('$index', '$key', '${expression.asCanonicalStringVal}') YIELD relationship AS ${variable.asCanonicalStringVal}" - case RelationshipByIndexQuery(variable, index, expression) => - s"CALL db.index.explicit.searchRelationships('$index', '${expression.asCanonicalStringVal}') YIELD relationship AS ${variable.asCanonicalStringVal}" - case AllNodes(variable) => s"MATCH (${variable.asCanonicalStringVal})" - case AllRelationships(variable) => s"MATCH ()-[${variable.asCanonicalStringVal}]->()" - case NodeByIds(variable, ids) => - if (ids.size == 1) s"MATCH (${variable.asCanonicalStringVal}) WHERE id(${variable.asCanonicalStringVal}) = ${ids.head.asCanonicalStringVal}" - else s"MATCH (${variable.asCanonicalStringVal}) WHERE id(${variable.asCanonicalStringVal}) IN ${ids.map(_.asCanonicalStringVal).mkString("[", ", ", "]")}" - case RelationshipByIds(variable, ids) => - if (ids.size == 1) s"MATCH ()-[${variable.asCanonicalStringVal}]->() WHERE id(${variable.asCanonicalStringVal}) = ${ids.head.asCanonicalStringVal}" - else s"MATCH ()-[${variable.asCanonicalStringVal}]->() WHERE id(${variable.asCanonicalStringVal}) IN ${ids.map(_.asCanonicalStringVal).mkString("[", ", ", "]")}" - case NodeByParameter(variable, parameter) => s"MATCH (${variable.asCanonicalStringVal}) WHERE id(${variable.asCanonicalStringVal}) IN ${parameter.asCanonicalStringVal}" - case RelationshipByParameter(variable, parameter) => s"MATCH ()-[${variable.asCanonicalStringVal}]->() WHERE id(${variable.asCanonicalStringVal}) IN ${parameter.asCanonicalStringVal}" - } - - rewritten.mkString(" ") - } - -} - -case class Match( - optional: Boolean, - pattern: Pattern, - hints: Seq[UsingHint], - where: Option[Where] - )(val position: InputPosition) extends Clause with SemanticAnalysisTooling { - override def name = "MATCH" - - override def semanticCheck: SemanticCheck = - SemanticPatternCheck.check(Pattern.SemanticContext.Match, pattern) chain - hints.semanticCheck chain - uniqueHints chain - where.semanticCheck chain - checkHints chain - checkForCartesianProducts chain - SemanticState.recordCurrentScope(this) - - private def uniqueHints: SemanticCheck = { - val errors = hints.groupBy(_.variables.toIndexedSeq).collect { - case pair@(variables, identHints) if identHints.size > 1 => - SemanticError("Multiple hints for same variable are not supported", variables.head.position, identHints.map(_.position): _*) - }.toVector - - (state: SemanticState) => SemanticCheckResult(state, errors) - } - - private def checkForCartesianProducts: SemanticCheck = (state: SemanticState) => { - import connectedComponents._ - val cc = connectedComponents(pattern.patternParts) - //if we have multiple connected components we will have - //a cartesian product - val newState = cc.drop(1).foldLeft(state) { (innerState, component) => - innerState.addNotification(CartesianProductNotification(position, component.variables.map(_.name))) - } - - SemanticCheckResult(newState, Seq.empty) - } - - private def checkHints: SemanticCheck = { - val error: Option[SemanticCheck] = hints.collectFirst { - case hint@UsingIndexHint(Variable(variable), LabelName(labelName), properties, _) - if !containsLabelPredicate(variable, labelName) => - SemanticError( - """|Cannot use index hint in this context. - | Must use label on node that hint is referring to.""".stripLinesAndMargins, hint.position) - case hint@UsingIndexHint(Variable(variable), LabelName(labelName), properties, _) - if !containsPropertyPredicates(variable, properties) => - SemanticError( - """|Cannot use index hint in this context. - | Index hints are only supported for the following predicates in WHERE - | (either directly or as part of a top-level AND or OR): - | equality comparison, inequality (range) comparison, STARTS WITH, - | IN condition or checking property existence. - | The comparison cannot be performed between two property values. - | Note that the label and property comparison must be specified on a - | non-optional node""".stripLinesAndMargins, hint.position) - case hint@UsingScanHint(Variable(variable), LabelName(labelName)) - if !containsLabelPredicate(variable, labelName) => - SemanticError( - """|Cannot use label scan hint in this context. - | Label scan hints require using a simple label test in WHERE (either directly or as part of a - | top-level AND). Note that the label must be specified on a non-optional node""".stripLinesAndMargins, hint.position) - case hint@UsingJoinHint(_) - if pattern.length == 0 => - SemanticError("Cannot use join hint for single node pattern.", hint.position) - } - error.getOrElse(SemanticCheckResult.success) - } - - private def containsPropertyPredicates(variable: String, propertiesInHint: Seq[PropertyKeyName]): Boolean = { - val propertiesInPredicates: Seq[String] = (where match { - case Some(w) => w.treeFold(Seq.empty[String]) { - case Equals(Property(Variable(id), PropertyKeyName(name)), other) if id == variable && applicable(other) => - acc => (acc :+ name, None) - case Equals(other, Property(Variable(id), PropertyKeyName(name))) if id == variable && applicable(other) => - acc => (acc :+ name, None) - case In(Property(Variable(id), PropertyKeyName(name)),_) if id == variable => - acc => (acc :+ name, None) - case predicate@FunctionInvocation(_, _, _, IndexedSeq(Property(Variable(id), PropertyKeyName(name)))) - if id == variable && predicate.function == functions.Exists => - acc => (acc :+ name, None) - case IsNotNull(Property(Variable(id), PropertyKeyName(name))) if id == variable => - acc => (acc :+ name, None) - case StartsWith(Property(Variable(id), PropertyKeyName(name)), _) if id == variable => - acc => (acc :+ name, None) - case EndsWith(Property(Variable(id), PropertyKeyName(name)), _) if id == variable => - acc => (acc :+ name, None) - case Contains(Property(Variable(id), PropertyKeyName(name)), _) if id == variable => - acc => (acc :+ name, None) - case expr: InequalityExpression => - acc => - val newAcc: Seq[String] = Seq(expr.lhs, expr.rhs).foldLeft(acc) { (acc, expr) => - expr match { - case Property(Variable(id), PropertyKeyName(name)) if id == variable => acc :+ name - case _ => acc - } - } - (newAcc, None) - case _: Where | _: And | _: Ands | _: Set[_] | _: Or | _: Ors => - acc => (acc, Some(identity)) - case _ => - acc => (acc, None) - } - case None => Seq.empty - }) ++ pattern.treeFold(Seq.empty[String]) { - case NodePattern(Some(Variable(id)), _, Some(MapExpression(prop))) if variable == id => - acc => (acc ++ prop.map(_._1.name), None) - } - - propertiesInHint.forall(p => propertiesInPredicates.contains(p.name)) - } - - /* - * Checks validity of the other side, X, of expressions such as - * USING INDEX ON n:Label(prop) WHERE n.prop = X (or X = n.prop) - * - * Returns true if X is a valid expression in this context, otherwise false. - */ - private def applicable(other: Expression) = { - other match { - case f: FunctionInvocation => f.function != functions.Id - case _ => true - } - } - - private def containsLabelPredicate(variable: String, label: String): Boolean = { - var labels = pattern.fold(Seq.empty[String]) { - case NodePattern(Some(Variable(id)), nodeLabels, _) if variable == id => - list => list ++ nodeLabels.map(_.name) - } - labels = where match { - case Some(innerWhere) => innerWhere.treeFold(labels) { - case HasLabels(Variable(id), predicateLabels) if id == variable => - acc => (acc ++ predicateLabels.map(_.name), None) - case _: Where | _: And | _: Ands | _: Set[_] => - acc => (acc, Some(identity)) - case _ => - acc => (acc, None) - } - case None => labels - } - labels.contains(label) - } -} - -case class Merge(pattern: Pattern, actions: Seq[MergeAction], where: Option[Where] = None)(val position: InputPosition) extends UpdateClause { - override def name = "MERGE" - - override def semanticCheck: SemanticCheck = - SemanticPatternCheck.check(Pattern.SemanticContext.Merge, pattern) chain - actions.semanticCheck chain - checkRelTypes - - // Copied code from CREATE below - private def checkRelTypes: SemanticCheck = - pattern.patternParts.foldSemanticCheck { - case EveryPath(RelationshipChain(_, rel, _)) if rel.types.size != 1 => - if (rel.types.size > 1) { - SemanticError("A single relationship type must be specified for MERGE", rel.position) - } else { - SemanticError("Exactly one relationship type must be specified for MERGE. Did you forget to prefix your relationship type with a ':'?", rel.position) - } - case _ => SemanticCheckResult.success - } -} - -case class Create(pattern: Pattern)(val position: InputPosition) extends UpdateClause { - override def name = "CREATE" - - override def semanticCheck: SemanticCheck = - SemanticPatternCheck.check(Pattern.SemanticContext.Create, pattern) chain - checkRelTypes - - //CREATE only support CREATE ()-[:T]->(), thus one-and-only-one type - private def checkRelTypes: SemanticCheck = - pattern.patternParts.foldSemanticCheck { - case EveryPath(RelationshipChain(_, rel, _)) if rel.types.size != 1 => - if (rel.types.size > 1) { - SemanticError("A single relationship type must be specified for CREATE", rel.position) - } else { - SemanticError("Exactly one relationship type must be specified for CREATE. Did you forget to prefix your relationship type with a ':'?", rel.position) - } - case _ => SemanticCheckResult.success - } -} - -case class CreateUnique(pattern: Pattern)(val position: InputPosition) extends UpdateClause { - override def name = "CREATE UNIQUE" - - override def semanticCheck = - SemanticError("CREATE UNIQUE is no longer supported. You can achieve the same result using MERGE", position) - -} - -case class SetClause(items: Seq[SetItem])(val position: InputPosition) extends UpdateClause { - override def name = "SET" - - override def semanticCheck: SemanticCheck = items.semanticCheck -} - -case class Delete(expressions: Seq[Expression], forced: Boolean)(val position: InputPosition) extends UpdateClause { - override def name = "DELETE" - - override def semanticCheck: SemanticCheck = - SemanticExpressionCheck.simple(expressions) chain - warnAboutDeletingLabels chain - expectType(CTNode.covariant | CTRelationship.covariant | CTPath.covariant, expressions) - - private def warnAboutDeletingLabels = - expressions.filter(_.isInstanceOf[HasLabels]) map { - e => SemanticError("DELETE doesn't support removing labels from a node. Try REMOVE.", e.position) - } -} - -case class Remove(items: Seq[RemoveItem])(val position: InputPosition) extends UpdateClause { - override def name = "REMOVE" - - override def semanticCheck: SemanticCheck = items.semanticCheck -} - -case class Foreach( - variable: Variable, - expression: Expression, - updates: Seq[Clause] - )(val position: InputPosition) extends UpdateClause { - override def name = "FOREACH" - - override def semanticCheck: SemanticCheck = - SemanticExpressionCheck.simple(expression) chain - expectType(CTList(CTAny).covariant, expression) chain - updates.filter(!_.isInstanceOf[UpdateClause]).map(c => SemanticError(s"Invalid use of ${c.name} inside FOREACH", c.position)) ifOkChain - withScopedState { - val possibleInnerTypes: TypeGenerator = types(expression)(_).unwrapLists - declareVariable(variable, possibleInnerTypes) chain updates.semanticCheck - } -} - -case class Unwind( - expression: Expression, - variable: Variable - )(val position: InputPosition) extends Clause with SemanticAnalysisTooling { - override def name = "UNWIND" - - override def semanticCheck: SemanticCheck = - SemanticExpressionCheck.check(SemanticContext.Results, expression) chain - expectType(CTList(CTAny).covariant, expression) ifOkChain { - val possibleInnerTypes: TypeGenerator = types(expression)(_).unwrapLists - declareVariable(variable, possibleInnerTypes) - } -} - -abstract class CallClause extends Clause { - override def name = "CALL" - def returnColumns: List[String] - def containsNoUpdates: Boolean -} - -case class UnresolvedCall(procedureNamespace: Namespace, - procedureName: ProcedureName, - // None: No arguments given - declaredArguments: Option[Seq[Expression]] = None, - // None: No results declared (i.e. no "YIELD" part) - declaredResult: Option[ProcedureResult] = None - )(val position: InputPosition) extends CallClause { - - override def returnColumns: List[String] = - declaredResult.map(_.items.map(_.variable.name).toList).getOrElse(List.empty) - - override def semanticCheck: SemanticCheck = { - val argumentCheck = declaredArguments.map( - SemanticExpressionCheck.check(SemanticContext.Results, _)).getOrElse(success) - val resultsCheck = declaredResult.map(_.semanticCheck).getOrElse(success) - val invalidExpressionsCheck = declaredArguments.map(_.map { - case arg if arg.containsAggregate => - error(_: SemanticState, - SemanticError( - """Procedure call cannot take an aggregating function as argument, please add a 'WITH' to your statement. - |For example: - | MATCH (n:Person) WITH collect(n.name) AS names CALL proc(names) YIELD value RETURN value""".stripMargin, position)) - case _ => success - }.foldLeft(success)(_ chain _)).getOrElse(success) - - argumentCheck chain resultsCheck chain invalidExpressionsCheck - } - - //At this stage we are not sure whether or not the procedure - // contains updates, so let's err on the side of caution - override def containsNoUpdates = false -} - -sealed trait HorizonClause extends Clause with SemanticAnalysisTooling { - override def semanticCheck: SemanticCheck = SemanticState.recordCurrentScope(this) - def semanticCheckContinuation(previousScope: Scope): SemanticCheck -} - -sealed trait ProjectionClause extends HorizonClause { - def distinct: Boolean - def returnItems: ReturnItemsDef - def graphReturnItems: Option[GraphReturnItems] - def orderBy: Option[OrderBy] - def skip: Option[Skip] - def limit: Option[Limit] - - final def isWith: Boolean = !isReturn - def isReturn: Boolean = false - - override def semanticCheck: SemanticCheck = - super.semanticCheck chain - returnItems.semanticCheck chain - graphReturnItems.semanticCheck - - override def semanticCheckContinuation(previousScope: Scope): SemanticCheck = { - val declareAllTheThings = (s: SemanticState) => { - val specialReturnItems = createSpecialReturnItems(previousScope, s) - val specialStateForShuffle = specialReturnItems.declareVariables(previousScope)(s).state - val shuffleResult = (orderBy.semanticCheck chain checkSkip chain checkLimit) (specialStateForShuffle) - val shuffleErrors = shuffleResult.errors - - // We still need to declare the return items, and register the use of variables in the ORDER BY clause. But we - // don't want to see errors from ORDER BY - we'll get them through shuffleErrors instead - val orderByResult = (returnItems.declareVariables(previousScope) chain ignoreErrors(orderBy.semanticCheck)) (s) - val fixedOrderByResult = specialReturnItems match { - case ReturnItems(star, items) if star => - val shuffleScope = shuffleResult.state.currentScope.scope - val definedHere = items.map(_.name).toSet - orderByResult.copy(orderByResult.state.mergeSymbolPositionsFromScope(shuffleScope, definedHere)) - case _ => - orderByResult - } - val tabularState = fixedOrderByResult.state - val graphResult = graphReturnItems.foldSemanticCheck(_.declareGraphs(previousScope, isReturn))(tabularState) - graphResult.copy(errors = fixedOrderByResult.errors ++ shuffleErrors ++ graphResult.errors) - } - val variableStar = returnItems.isStarOnly - val graphsStar = graphReturnItems.forall(_.isGraphsStarOnly) - declareAllTheThings - } - - private def createSpecialReturnItems(previousScope: Scope, s: SemanticState): ReturnItemsDef = { - // ORDER BY lives in this special scope that has access to things in scope before the RETURN/WITH clause, - // but also to the variables introduced by RETURN/WITH. This is most easily done by turning - // RETURN a, b, c => RETURN *, a, b, c - - // Except when we are doing DISTINCT or aggregation, in which case we only see the scope introduced by the - // projecting clause - val includePreviousScope = !(returnItems.containsAggregate || distinct) - val specialReturnItems = returnItems.withExisting(includePreviousScope) - specialReturnItems - } - - // use an empty state when checking skip & limit, as these have entirely isolated context - private def checkSkip: SemanticState => Seq[SemanticErrorDef] = - s => skip.semanticCheck(SemanticState.clean).errors - - private def checkLimit: SemanticState => Seq[SemanticErrorDef] = - s => limit.semanticCheck(SemanticState.clean).errors - - private def ignoreErrors(inner: SemanticCheck): SemanticCheck = - s => SemanticCheckResult.success(inner.apply(s).state) - - def verifyOrderByAggregationUse(fail: (String, InputPosition) => Nothing): Unit = { - val aggregationInProjection = returnItems.containsAggregate - val aggregationInOrderBy = orderBy.exists(_.sortItems.map(_.expression).exists(containsAggregate)) - if (!aggregationInProjection && aggregationInOrderBy) - fail(s"Cannot use aggregation in ORDER BY if there are no aggregate expressions in the preceding $name", position) - } -} - -object From { - def apply(graph: SingleGraphAs)(position: InputPosition): With = { - With(ReturnItems(includeExisting = true, Seq.empty)(position), GraphReturnItems(includeExisting = true, Seq(NewContextGraphs(graph)(position)))(position))(position) - } -} - -object Into { - def apply(graph: SingleGraphAs)(position: InputPosition): With = { - With(ReturnItems(includeExisting = true, Seq.empty)(position), GraphReturnItems(includeExisting = true, Seq(NewTargetGraph(graph)(position)))(position))(position) - } -} - -object With { - def apply(graphReturnItems: GraphReturnItems)(pos: InputPosition): With = - With(distinct = false, DiscardCardinality()(pos), graphReturnItems, None, None, None, None)(pos) - - def apply(returnItems: ReturnItemsDef, graphReturnItems: GraphReturnItems)(pos: InputPosition): With = - With(distinct = false, returnItems, graphReturnItems, None, None, None, None)(pos) -} - -case class With(distinct: Boolean, - returnItems: ReturnItemsDef, - mandatoryGraphReturnItems: GraphReturnItems, - orderBy: Option[OrderBy], - skip: Option[Skip], - limit: Option[Limit], - where: Option[Where] -)(val position: InputPosition) extends ProjectionClause { - - override def name = "WITH" - - override def graphReturnItems = Some(mandatoryGraphReturnItems) - - override def semanticCheck: SemanticCheck = - super.semanticCheck chain - checkAliasedReturnItems - - override def semanticCheckContinuation(previousScope: Scope): SemanticCheck = - super.semanticCheckContinuation(previousScope) chain - where.semanticCheck - - private def checkAliasedReturnItems: SemanticState => Seq[SemanticError] = state => returnItems match { - case li: ReturnItems => li.items.filter(_.alias.isEmpty).map(i => SemanticError("Expression in WITH must be aliased (use AS)", i.position)) - case _ => Seq() - } -} - -object Return { - def apply(graphReturnItems: GraphReturnItems)(pos: InputPosition): Return = - Return(distinct = false, DiscardCardinality()(pos), Some(graphReturnItems), None, None, None)(pos) - - def apply(returnItems: ReturnItemsDef, graphReturnItems: Option[GraphReturnItems])(pos: InputPosition): Return = - Return(distinct = false, returnItems, graphReturnItems, None, None, None)(pos) -} - -case class Return(distinct: Boolean, - returnItems: ReturnItemsDef, - graphReturnItems: Option[GraphReturnItems], - orderBy: Option[OrderBy], - skip: Option[Skip], - limit: Option[Limit], - excludedNames: Set[String] = Set.empty)(val position: InputPosition) extends ProjectionClause { - - override def name = "RETURN" - - override def isReturn: Boolean = true - - override def returnColumns: List[String] = returnItems.items.map(_.name).toList - - override def semanticCheck: SemanticCheck = super.semanticCheck chain checkVariableScope - - private def checkVariableScope: SemanticState => Seq[SemanticError] = s => - returnItems match { - case ReturnItems(star, _) if star && s.currentScope.isEmpty => - Seq(SemanticError("RETURN * is not allowed when there are no variables in scope", position)) - case _ => - Seq.empty - } -} - -case class PragmaWithout(excluded: Seq[LogicalVariable])(val position: InputPosition) extends HorizonClause { - override def name = "_PRAGMA WITHOUT" - val excludedNames: Set[String] = excluded.map(_.name).toSet - - override def semanticCheckContinuation(previousScope: Scope): SemanticCheck = s => - SemanticCheckResult.success(s.importValuesFromScope(previousScope, excludedNames)) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Command.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Command.scala deleted file mode 100644 index f3e382d5fc40b..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Command.scala +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.frontend.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticAnalysisTooling, SemanticError, SemanticExpressionCheck} -import org.neo4j.cypher.internal.util.v3_5.symbols.{CypherType, _} -import org.neo4j.cypher.internal.v3_5.expressions._ - -sealed trait Command extends Statement { - override def returnColumns = List.empty -} - -case class CreateIndex(label: LabelName, properties: List[PropertyKeyName])(val position: InputPosition) extends Command { -// def property = properties(0) - def semanticCheck = Seq() -} - -case class DropIndex(label: LabelName, properties: List[PropertyKeyName])(val position: InputPosition) extends Command { - def property = properties.head - def semanticCheck = Seq() -} - -trait PropertyConstraintCommand extends Command with SemanticAnalysisTooling { - def variable: Variable - - def property: Property - - def entityType: CypherType - - def semanticCheck = - declareVariable(variable, entityType) chain - SemanticExpressionCheck.simple(property) chain - when(!property.map.isInstanceOf[Variable]) { - error("Cannot index nested properties", property.position) - } -} - -trait CompositePropertyConstraintCommand extends Command with SemanticAnalysisTooling { - def variable: Variable - - def properties: Seq[Property] - - def entityType: CypherType - - def restrictedToSingleProperty: Boolean - - def semanticCheck = - declareVariable(variable, entityType) chain - SemanticExpressionCheck.simple(properties) chain - semanticCheckFold(properties) { - property => - when(!property.map.isInstanceOf[Variable]) { - error("Cannot index nested properties", property.position) - } - } chain - when(restrictedToSingleProperty && properties.size > 1) { - error("Only single property uniqueness constraints are supported", properties(1).position) - } -} - -trait NodePropertyConstraintCommand extends PropertyConstraintCommand { - - val entityType = CTNode - - def label: LabelName -} - -trait UniquePropertyConstraintCommand extends CompositePropertyConstraintCommand { - - val entityType = CTNode - - def label: LabelName - - override def restrictedToSingleProperty: Boolean = true -} - -trait NodeKeyConstraintCommand extends CompositePropertyConstraintCommand { - - val entityType = CTNode - - def label: LabelName - - override def restrictedToSingleProperty: Boolean = false -} - -trait RelationshipPropertyConstraintCommand extends PropertyConstraintCommand { - - val entityType = CTRelationship - - def relType: RelTypeName -} - -case class CreateNodeKeyConstraint(variable: Variable, label: LabelName, properties: Seq[Property])(val position: InputPosition) extends NodeKeyConstraintCommand - -case class DropNodeKeyConstraint(variable: Variable, label: LabelName, properties: Seq[Property])(val position: InputPosition) extends NodeKeyConstraintCommand - -case class CreateUniquePropertyConstraint(variable: Variable, label: LabelName, properties: Seq[Property])(val position: InputPosition) extends UniquePropertyConstraintCommand - -case class DropUniquePropertyConstraint(variable: Variable, label: LabelName, properties: Seq[Property])(val position: InputPosition) extends UniquePropertyConstraintCommand - -case class CreateNodePropertyExistenceConstraint(variable: Variable, label: LabelName, property: Property)(val position: InputPosition) extends NodePropertyConstraintCommand - -case class DropNodePropertyExistenceConstraint(variable: Variable, label: LabelName, property: Property)(val position: InputPosition) extends NodePropertyConstraintCommand - -case class CreateRelationshipPropertyExistenceConstraint(variable: Variable, relType: RelTypeName, property: Property)(val position: InputPosition) extends RelationshipPropertyConstraintCommand - -case class DropRelationshipPropertyExistenceConstraint(variable: Variable, relType: RelTypeName, property: Property)(val position: InputPosition) extends RelationshipPropertyConstraintCommand diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/GraphRef.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/GraphRef.scala deleted file mode 100644 index c0beb66e32500..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/GraphRef.scala +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition} -import org.neo4j.cypher.internal.frontend.v3_5.SemanticCheck -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticCheckable, SemanticExpressionCheck} -import org.neo4j.cypher.internal.v3_5.expressions.Variable - -final case class GraphRef(name: Variable)(val position: InputPosition) - extends ASTNode with SemanticCheckable { - - override def semanticCheck: SemanticCheck = - SemanticExpressionCheck.simple(name) -} - - - diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/GraphReturnItems.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/GraphReturnItems.scala deleted file mode 100644 index afdc2dc25e2fc..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/GraphReturnItems.scala +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition} -import org.neo4j.cypher.internal.frontend.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticCheckResult.success -import org.neo4j.cypher.internal.frontend.v3_5.semantics._ - -sealed trait GraphReturnItem extends ASTNode { - def graphs: Set[SingleGraphAs] - - def newSource: Option[SingleGraphAs] = None - def newTarget: Option[SingleGraphAs] = None - - def filter(pred: SingleGraphAs => Boolean): Option[GraphReturnItem] -} - -final case class ReturnedGraph(item: SingleGraphAs)(val position: InputPosition) extends GraphReturnItem { - override def graphs: Set[SingleGraphAs] = Set(item) - - override def filter(pred: SingleGraphAs => Boolean): Option[GraphReturnItem] = - if (pred(item)) Some(this) else None -} - -final case class NewTargetGraph(target: SingleGraphAs)(val position: InputPosition) extends GraphReturnItem { - override def graphs: Set[SingleGraphAs] = Set(target) - override def newTarget = Some(target) - - override def filter(pred: SingleGraphAs => Boolean): Option[GraphReturnItem] = - if (pred(target)) Some(this) else None -} - -final case class NewContextGraphs(source: SingleGraphAs, - override val newTarget: Option[SingleGraphAs] = None) - (val position: InputPosition) extends GraphReturnItem { - - override def graphs: Set[SingleGraphAs] = Set(source) ++ newTarget.toSet - - override def newSource: Option[SingleGraphAs] = Some(source) - - override def filter(pred: SingleGraphAs => Boolean): Option[GraphReturnItem] = - if (pred(source)) - newTarget.map(pred(_)) match { - case Some(false) => Some(NewContextGraphs(source, None)(position)) - case _ => Some(this) - } - else - newTarget.flatMap { target => if (pred(target)) Some(NewTargetGraph(target)(position)) else None } -} - -object PassAllGraphReturnItems { - def apply(position: InputPosition): GraphReturnItems = - GraphReturnItems(includeExisting = true, Seq.empty)(position) -} - -final case class GraphReturnItems(includeExisting: Boolean, items: Seq[GraphReturnItem]) - (val position: InputPosition) - extends ASTNode with SemanticCheckable with SemanticAnalysisTooling { - - def isGraphsStarOnly: Boolean = includeExisting && items.isEmpty - - val graphs: Seq[SingleGraphAs] = items.flatMap(_.graphs) - - val singleGraph: Option[SingleGraphAs] = if (!includeExisting && graphs.nonEmpty && graphs.tail.isEmpty) graphs.headOption else None - val newSource: Option[SingleGraphAs] = singleGraph orElse items.flatMap(_.newSource).headOption - val newTarget: Option[SingleGraphAs] = items.flatMap(_.newTarget).headOption orElse newSource - - override def semanticCheck: SemanticCheck = - unless(items.isEmpty) { - requireMultigraphSupport("Projecting and returning graphs", position) - } chain ( - graphs.semanticCheck chain - checkNoMultipleSources chain - checkNoMultipleTargets chain - checkUniqueGraphReference - ).ifFeatureEnabled(SemanticFeature.MultipleGraphs) - - def declareGraphs(previousScope: Scope, isReturn: Boolean): SemanticCheck = { - val updateContext = (s: SemanticState) => { - if (isReturn) - s.removeContextGraphs() - else { - val previousContext = previousScope.contextGraphs - val newSourceName = newSource.flatMap(_.name(previousContext)) - val newTargetName = newTarget.flatMap(_.name(previousContext)) - val optNewContextGraphs = - previousScope.contextGraphs.map(_.updated(newSourceName, newTargetName)) orElse - newSourceName.map(source => newTargetName.map(target => ContextGraphs(source, target)).getOrElse(ContextGraphs(source, source))) - optNewContextGraphs match { - case Some(newContextGraphs) => s.updateContextGraphs(newContextGraphs) - // If there are no context graphs that's fine -- use the ambient graph - case None => Right(s) - } - } - } - ( - when (includeExisting) { s => success(s.importGraphsFromScope(previousScope)) } chain - items.flatMap(_.graphs).foldSemanticCheck(_.declareGraph) chain - items.flatMap(_.graphs).foldSemanticCheck(_.implicitGraph(previousScope.contextGraphs)) chain - updateContext - ).ifFeatureEnabled(SemanticFeature.MultipleGraphs) - } - - private def checkNoMultipleSources: SemanticCheck = - (s: SemanticState) => - if (items.flatMap(_.newSource).size > 1) - SemanticCheckResult.error(s, SemanticError("Setting multiple source graphs is not allowed", position)) - else SemanticCheckResult.success(s) - - private def checkNoMultipleTargets: SemanticCheck = - (s: SemanticState) => - if (items.flatMap(_.newTarget).size > 1) - SemanticCheckResult.error(s, SemanticError("Setting multiple target graphs is not allowed", position)) - else SemanticCheckResult.success(s) - - private def checkUniqueGraphReference: SemanticCheck = { - (s: SemanticState) => { - val aliases = graphs.flatMap(_.as) - if (aliases.size == aliases.toSet.size) - SemanticCheckResult.success(s) - else - SemanticCheckResult.error(s, SemanticError("Multiple result graphs with the same name are not supported", position)) - } - } -} - diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/GraphUrl.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/GraphUrl.scala deleted file mode 100644 index 2116e528bd204..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/GraphUrl.scala +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.symbols.CTString -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition} -import org.neo4j.cypher.internal.frontend.v3_5.SemanticCheck -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticAnalysisTooling, SemanticCheckable, SemanticExpressionCheck} -import org.neo4j.cypher.internal.v3_5.expressions.{Parameter, StringLiteral} - -final case class GraphUrl(url: Either[Parameter, StringLiteral])(val position: InputPosition) - extends ASTNode with SemanticCheckable with SemanticAnalysisTooling { - - override def semanticCheck: SemanticCheck = url match { - case Left(parameter) => - SemanticExpressionCheck.simple(parameter) chain - expectType(CTString.covariant, parameter) - - case Right(literal) => - SemanticExpressionCheck.simple(literal) chain - expectType(CTString.covariant, literal) - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Hint.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Hint.scala deleted file mode 100644 index 089611f9fb9bf..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Hint.scala +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition, InternalException, NonEmptyList} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticAnalysisTooling, SemanticCheckable} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions._ - -sealed trait Hint extends ASTNode with SemanticCheckable with SemanticAnalysisTooling { - def variables: NonEmptyList[Variable] -} - -trait NodeHint { - self: Hint => -} - -trait RelationshipHint { - self: Hint => -} - -object Hint { - implicit val byVariable: Ordering[Hint] = - Ordering.by { (hint: Hint) => hint.variables.head }(Variable.byName) -} -// allowed on match - -sealed trait UsingHint extends Hint - -// allowed on start item - -sealed trait ExplicitIndexHint extends UsingHint { - self: StartItem => - - def variable: Variable - def variables = NonEmptyList(variable) -} - -sealed trait UsingIndexHintSpec { - def fulfilledByScan: Boolean -} -case object SeekOnly extends UsingIndexHintSpec { - override def fulfilledByScan: Boolean = false -} -case object SeekOrScan extends UsingIndexHintSpec { - override def fulfilledByScan: Boolean = true -} - -case class UsingIndexHint( - variable: Variable, - label: LabelName, - properties: Seq[PropertyKeyName], - spec: UsingIndexHintSpec = SeekOrScan - )(val position: InputPosition) extends UsingHint with NodeHint { - def variables = NonEmptyList(variable) - def semanticCheck = ensureDefined(variable) chain expectType(CTNode.covariant, variable) - - override def toString: String = s"USING INDEX ${if(spec == SeekOnly) "SEEK " else ""}${variable.name}:${label.name}(${properties.map(_.name).mkString(", ")})" -} - -case class UsingScanHint(variable: Variable, label: LabelName)(val position: InputPosition) extends UsingHint with NodeHint { - def variables = NonEmptyList(variable) - def semanticCheck = ensureDefined(variable) chain expectType(CTNode.covariant, variable) - - override def toString: String = s"USING SCAN ${variable.name}:${label.name}" -} - -object UsingJoinHint { - import NonEmptyList._ - - def apply(elts: Seq[Variable])(pos: InputPosition): UsingJoinHint = - UsingJoinHint(elts.toNonEmptyListOption.getOrElse(throw new InternalException("Expected non-empty sequence of variables")))(pos) -} - -case class UsingJoinHint(variables: NonEmptyList[Variable])(val position: InputPosition) extends UsingHint with NodeHint { - def semanticCheck = - variables.map { variable => ensureDefined(variable) chain expectType(CTNode.covariant, variable) }.reduceLeft(_ chain _) - - override def toString: String = s"USING JOIN ON ${variables.map(_.name).toIndexedSeq.mkString(", ")}" -} - -// start items - -sealed trait StartItem extends ASTNode with SemanticCheckable with SemanticAnalysisTooling { - def variable: Variable - def name = variable.name -} - -sealed trait NodeStartItem extends StartItem { - def semanticCheck = declareVariable(variable, CTNode) -} - -case class NodeByIdentifiedIndex(variable: Variable, index: String, key: String, value: Expression)(val position: InputPosition) - extends NodeStartItem with ExplicitIndexHint with NodeHint - -case class NodeByIndexQuery(variable: Variable, index: String, query: Expression)(val position: InputPosition) - extends NodeStartItem with ExplicitIndexHint with NodeHint - -case class NodeByParameter(variable: Variable, parameter: Parameter)(val position: InputPosition) extends NodeStartItem -case class AllNodes(variable: Variable)(val position: InputPosition) extends NodeStartItem - -sealed trait RelationshipStartItem extends StartItem { - def semanticCheck = declareVariable(variable, CTRelationship) -} - -case class RelationshipByIds(variable: Variable, ids: Seq[UnsignedIntegerLiteral])(val position: InputPosition) extends RelationshipStartItem -case class RelationshipByParameter(variable: Variable, parameter: Parameter)(val position: InputPosition) extends RelationshipStartItem -case class AllRelationships(variable: Variable)(val position: InputPosition) extends RelationshipStartItem -case class RelationshipByIdentifiedIndex(variable: Variable, index: String, key: String, value: Expression)(val position: InputPosition) extends RelationshipStartItem with ExplicitIndexHint with RelationshipHint -case class RelationshipByIndexQuery(variable: Variable, index: String, query: Expression)(val position: InputPosition) extends RelationshipStartItem with ExplicitIndexHint with RelationshipHint - -// no longer supported non-hint legacy start items - -case class NodeByIds(variable: Variable, ids: Seq[UnsignedIntegerLiteral])(val position: InputPosition) extends NodeStartItem - diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Limit.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Limit.scala deleted file mode 100644 index 9302a72fdefb6..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Limit.scala +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition} -import org.neo4j.cypher.internal.v3_5.expressions.Expression - -case class Limit(expression: Expression)(val position: InputPosition) extends ASTNode with ASTSlicingPhrase { - override def name = "LIMIT" // ASTSlicingPhrase name -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/MergeAction.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/MergeAction.scala deleted file mode 100644 index 6b787336528b1..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/MergeAction.scala +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition} -import org.neo4j.cypher.internal.frontend.v3_5.SemanticCheck -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticCheckable - -sealed trait MergeAction extends ASTNode with SemanticCheckable - -case class OnCreate(action: SetClause)(val position: InputPosition) extends MergeAction { - def semanticCheck: SemanticCheck = action.semanticCheck -} - -case class OnMatch(action: SetClause)(val position: InputPosition) extends MergeAction { - def semanticCheck: SemanticCheck = action.semanticCheck -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Order.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Order.scala deleted file mode 100644 index b7cab734340b0..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Order.scala +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticCheckable, SemanticExpressionCheck} -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition} -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, LogicalVariable} - -case class OrderBy(sortItems: Seq[SortItem])(val position: InputPosition) extends ASTNode with SemanticCheckable { - def semanticCheck = sortItems.semanticCheck - - def dependencies: Set[LogicalVariable] = - sortItems.foldLeft(Set.empty[LogicalVariable]) { case (acc, item) => acc ++ item.expression.dependencies } -} - -sealed trait SortItem extends ASTNode with SemanticCheckable { - def expression: Expression - def semanticCheck = SemanticExpressionCheck.check(Expression.SemanticContext.Results, expression) - - def mapExpression(f: Expression => Expression): SortItem -} - -case class AscSortItem(expression: Expression)(val position: InputPosition) extends SortItem { - override def mapExpression(f: Expression => Expression) = copy(expression = f(expression))(position) -} - -case class DescSortItem(expression: Expression)(val position: InputPosition) extends SortItem { - override def mapExpression(f: Expression => Expression) = copy(expression = f(expression))(position) -} - diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/PeriodicCommitHint.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/PeriodicCommitHint.scala deleted file mode 100644 index 917bc74f1732e..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/PeriodicCommitHint.scala +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition} -import org.neo4j.cypher.internal.frontend.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticCheckResult, SemanticCheckable, SemanticError} -import org.neo4j.cypher.internal.v3_5.expressions.IntegerLiteral - -case class PeriodicCommitHint(size: Option[IntegerLiteral])(val position: InputPosition) extends ASTNode with SemanticCheckable { - def name = s"USING PERIODIC COMMIT $size" - - override def semanticCheck: SemanticCheck = size match { - case Some(integer) if integer.value <= 0 => - SemanticError(s"Commit size error - expected positive value larger than zero, got ${integer.value}", integer.position) - case _ => - SemanticCheckResult.success - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ProcedureResult.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ProcedureResult.scala deleted file mode 100644 index 8b603b76e9174..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ProcedureResult.scala +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition} -import org.neo4j.cypher.internal.frontend.v3_5.SemanticCheck -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticCheckResult.success - -object ProcedureResult { - def from(items: ProcedureResultItem*)(position: InputPosition): ProcedureResult = - ProcedureResult(items.toIndexedSeq, None)(position) -} - -case class ProcedureResult(items: IndexedSeq[ProcedureResultItem], where: Option[Where] = None) - (val position: InputPosition) - extends ASTNode { - - def semanticCheck: SemanticCheck = - items.foldSemanticCheck(_.semanticCheck) chain where.map(_.semanticCheck).getOrElse(success) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ProcedureResultItem.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ProcedureResultItem.scala deleted file mode 100644 index b7b551c152684..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ProcedureResultItem.scala +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition} -import org.neo4j.cypher.internal.frontend.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticAnalysisTooling -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{LogicalVariable, ProcedureOutput, Variable} - -object ProcedureResultItem { - def apply(output: ProcedureOutput, variable: Variable)(position: InputPosition): ProcedureResultItem = - ProcedureResultItem(Some(output), variable)(position) - - def apply(variable: Variable)(position: InputPosition): ProcedureResultItem = - ProcedureResultItem(None, variable)(position) -} - -case class ProcedureResultItem(output: Option[ProcedureOutput], variable: LogicalVariable)(val position: InputPosition) - extends ASTNode with SemanticAnalysisTooling { - - val outputName: String = output.map(_.name).getOrElse(variable.name) - - def semanticCheck: SemanticCheck = - // This is needed to prevent the initial round of semantic checking from failing with type errors - // when procedure signatures have not yet been resolved - declareVariable(variable, TypeSpec.all) - - def semanticCheck(types: Map[String, CypherType]): SemanticCheck = - types - .get(outputName) - .map { typ => declareVariable(variable, typ): SemanticCheck } - .getOrElse(error(s"Unknown procedure output: `$outputName`", position)) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Query.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Query.scala deleted file mode 100644 index 4e183ab5963b8..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Query.scala +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition} -import org.neo4j.cypher.internal.frontend.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics._ - -case class Query(periodicCommitHint: Option[PeriodicCommitHint], part: QueryPart)(val position: InputPosition) - extends Statement with SemanticAnalysisTooling { - - override def returnColumns = part.returnColumns - - override def semanticCheck = - part.semanticCheck chain - periodicCommitHint.semanticCheck chain - when(periodicCommitHint.nonEmpty && !part.containsUpdates) { - SemanticError("Cannot use periodic commit in a non-updating query", periodicCommitHint.get.position) - } -} - -sealed trait QueryPart extends ASTNode with SemanticCheckable { - def containsUpdates: Boolean - def returnColumns: List[String] -} - -case class SingleQuery(clauses: Seq[Clause])(val position: InputPosition) extends QueryPart { - assert(clauses.nonEmpty) - - override def containsUpdates = - clauses.exists { - case call: CallClause => !call.containsNoUpdates - case _: UpdateClause => true - case _ => false - } - - override def returnColumns = clauses.last.returnColumns - - override def semanticCheck = - checkStandaloneCall chain - checkOrder chain - checkClauses chain - checkIndexHints - - private def checkIndexHints: SemanticCheck = s => { - val hints = clauses.collect { case m: Match => m.hints }.flatten - val hasStartClause = clauses.exists(_.isInstanceOf[Start]) - if (hints.nonEmpty && hasStartClause) { - SemanticCheckResult.error(s, SemanticError("Cannot use planner hints with start clause", hints.head.position)) - } else { - SemanticCheckResult.success(s) - } - } - - private def checkStandaloneCall: SemanticCheck = s => { - clauses match { - case Seq(call: UnresolvedCall, where: With) => - SemanticCheckResult.error(s, SemanticError("Cannot use standalone call with WHERE (instead use: `CALL ... WITH * WHERE ... RETURN *`)", where.position)) - case _ => - SemanticCheckResult.success(s) - } - } - - private def checkOrder: SemanticCheck = s => { - val (lastPair, errors) = clauses.sliding(2).foldLeft(Seq.empty[Clause], Vector.empty[SemanticError]) { - case ((_, semanticErrors), pair) => - val optError = pair match { - case Seq(_: With, _: Start) => - None - case Seq(clause, start: Start) => - Some(SemanticError(s"WITH is required between ${clause.name} and ${start.name}", clause.position, start.position)) - case Seq(match1: Match, match2: Match) if match1.optional && !match2.optional => - Some(SemanticError(s"${match2.name} cannot follow OPTIONAL ${match1.name} (perhaps use a WITH clause between them)", match2.position, match1.position)) - case Seq(clause: Return, _) => - Some(SemanticError(s"${clause.name} can only be used at the end of the query", clause.position)) - case Seq(_: UpdateClause, _: UpdateClause) => - None - case Seq(_: UpdateClause, _: With) => - None - case Seq(_: UpdateClause, _: Return) => - None - case Seq(update: UpdateClause, clause) => - Some(SemanticError(s"WITH is required between ${update.name} and ${clause.name}", clause.position, update.position)) - case _ => - None - } - (pair, optError.fold(semanticErrors)(semanticErrors :+ _)) - } - - val lastError = lastPair.last match { - case _: UpdateClause => None - case _: Return => None - case _: CallClause if clauses.size == 1 => None - case clause => - Some(SemanticError(s"Query cannot conclude with ${clause.name} (must be RETURN or an update clause)", clause.position)) - } - - SemanticCheckResult(s, errors ++ lastError) - } - - private def checkClauses: SemanticCheck = s => { - val result = clauses.zipWithIndex.foldLeft(SemanticCheckResult.success(s.newChildScope)) { - case (lastResult, (clause, idx)) => clause match { - case w: With if idx == 0 && lastResult.state.features(SemanticFeature.WithInitialQuerySignature) => - checkHorizon(w, lastResult.state.recogniseInitialWith, lastResult.errors) - case c: HorizonClause => - checkHorizon(c, lastResult.state.clearInitialWith, lastResult.errors) - case _ => - val result = clause.semanticCheck(lastResult.state.clearInitialWith) - SemanticCheckResult(result.state, lastResult.errors ++ result.errors) - } - } - SemanticCheckResult(result.state.popScope, result.errors) - } - - private def checkHorizon(clause: HorizonClause, state: SemanticState, prevErrors: Seq[SemanticErrorDef]) = { - val closingResult = clause.semanticCheck(state) - val nextState = closingResult.state.newSiblingScope - val continuationResult = clause.semanticCheckContinuation(closingResult.state.currentScope.scope)(nextState) - SemanticCheckResult(continuationResult.state, prevErrors ++ closingResult.errors ++ continuationResult.errors) - } -} - -sealed trait Union extends QueryPart with SemanticAnalysisTooling { - def part: QueryPart - def query: SingleQuery - - def returnColumns = query.returnColumns - - def containsUpdates:Boolean = part.containsUpdates || query.containsUpdates - - def semanticCheck: SemanticCheck = - checkUnionAggregation chain - withScopedState(part.semanticCheck) chain - withScopedState(query.semanticCheck) chain - checkColumnNamesAgree - - private def checkColumnNamesAgree: SemanticCheck = (state: SemanticState) => { - val rootScope: Scope = state.currentScope.scope - - // UNION queries form a chain in the shape of a reversed linked list. - // Therefore, the second scope is always a shallow scope, where the last one corresponds to the RETURN clause. - // The first one may either be another UNION query part or a single query. - val first :: second :: Nil = rootScope.children - val newFirst = part match { - case _: Union => // Union query parts always have two child scopes. - val _ :: newFirst :: Nil = first.children - newFirst - case _ => first - } - val errors = if (newFirst.children.last.symbolNames == second.children.last.symbolNames) { - Seq.empty - } else { - Seq(SemanticError("All sub queries in an UNION must have the same column names", position)) - } - SemanticCheckResult(state, errors) - } - - private def checkUnionAggregation: SemanticCheck = (part, this) match { - case (_: SingleQuery, _) => None - case (_: UnionAll, _: UnionAll) => None - case (_: UnionDistinct, _: UnionDistinct) => None - case _ => Some(SemanticError("Invalid combination of UNION and UNION ALL", position)) - } - - def unionedQueries: Seq[SingleQuery] = unionedQueries(Vector.empty) - private def unionedQueries(accum: Seq[SingleQuery]): Seq[SingleQuery] = part match { - case q: SingleQuery => accum :+ query :+ q - case u: Union => u.unionedQueries(accum :+ query) - } -} - -final case class UnionAll(part: QueryPart, query: SingleQuery)(val position: InputPosition) extends Union -final case class UnionDistinct(part: QueryPart, query: SingleQuery)(val position: InputPosition) extends Union diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/RemoveItem.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/RemoveItem.scala deleted file mode 100644 index b6e25a30855d5..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/RemoveItem.scala +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticCheckable, SemanticExpressionCheck} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition} -import org.neo4j.cypher.internal.v3_5.expressions.{LabelName, LogicalProperty, LogicalVariable} - -sealed trait RemoveItem extends ASTNode with SemanticCheckable - -case class RemoveLabelItem(variable: LogicalVariable, labels: Seq[LabelName])(val position: InputPosition) extends RemoveItem { - def semanticCheck = - SemanticExpressionCheck.simple(variable) chain - SemanticExpressionCheck.expectType(CTNode.covariant, variable) -} - -case class RemovePropertyItem(property: LogicalProperty) extends RemoveItem { - def position = property.position - - def semanticCheck = SemanticExpressionCheck.simple(property) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ReturnItem.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ReturnItem.scala deleted file mode 100644 index 45f8e8007ec73..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ReturnItem.scala +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.frontend.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticCheckResult.success -import org.neo4j.cypher.internal.frontend.v3_5.semantics._ -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition, InternalException} -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, LogicalVariable, MapProjection} - -sealed trait ReturnItemsDef extends ASTNode with SemanticCheckable with SemanticAnalysisTooling { - /** - * Users must specify return items for the projection, either all variables (*), no variables (-), or explicit expressions. - * Neo4j does not support the no variables case on the surface, but it may appear as the result of expanding the star (*) when no variables are in scope. - * This field is true if the dash (-) was used by a user. - */ - def includeExisting: Boolean - def declareVariables(previousScope: Scope): SemanticCheck - def containsAggregate: Boolean - def withExisting(includeExisting: Boolean): ReturnItemsDef - def items: Seq[ReturnItem] - - def isStarOnly: Boolean = includeExisting && items.isEmpty -} - -final case class DiscardCardinality()(val position: InputPosition) extends ReturnItemsDef { - override def includeExisting: Boolean = false - override def semanticCheck: SemanticCheck = _success - override def items: Seq[ReturnItem] = Seq.empty - override def declareVariables(previousScope: Scope): (SemanticState) => SemanticCheckResult = _success - override def containsAggregate = false - override def withExisting(includeExisting: Boolean): DiscardCardinality = this - private def _success(s: SemanticState) = success(s) -} - -final case class ReturnItems( - includeExisting: Boolean, - items: Seq[ReturnItem] - )(val position: InputPosition) extends ReturnItemsDef with SemanticAnalysisTooling { - - override def withExisting(includeExisting: Boolean): ReturnItemsDef = - copy(includeExisting = includeExisting)(position) - - override def semanticCheck: SemanticCheck = items.semanticCheck chain ensureProjectedToUniqueIds - - def aliases: Set[LogicalVariable] = items.flatMap(_.alias).toSet - - def passedThrough: Set[LogicalVariable] = items.collect { - case item => item.alias.collect { case ident if ident == item.expression => ident } - }.flatten.toSet - - def mapItems(f: Seq[ReturnItem] => Seq[ReturnItem]): ReturnItems = - copy(items = f(items))(position) - - override def declareVariables(previousScope: Scope): SemanticCheck = - when (includeExisting) { - s => success(s.importValuesFromScope(previousScope)) - } chain items.foldSemanticCheck(item => item.alias match { - case Some(variable) if item.expression == variable => - val positions = previousScope.symbol(variable.name).fold(Set.empty[InputPosition])(_.positions) - declareVariable(variable, types(item.expression), positions) - case Some(variable) => declareVariable(variable, types(item.expression)) - case None => (state) => SemanticCheckResult(state, Seq.empty) - }) - - private def ensureProjectedToUniqueIds: SemanticCheck = { - items.groupBy(_.name).foldLeft(success) { - case (acc, (k, items)) if items.size > 1 => - acc chain SemanticError("Multiple result columns with the same name are not supported", items.head.position) - case (acc, _) => - acc - } - } - - override def containsAggregate = items.exists(_.expression.containsAggregate) -} - -sealed trait ReturnItem extends ASTNode with SemanticCheckable { - def expression: Expression - def alias: Option[LogicalVariable] - def name: String - def makeSureIsNotUnaliased(state: SemanticState): SemanticCheckResult - - def semanticCheck = SemanticExpressionCheck.check(Expression.SemanticContext.Results, expression) -} - -case class UnaliasedReturnItem(expression: Expression, inputText: String)(val position: InputPosition) extends ReturnItem { - val alias = expression match { - case i: LogicalVariable => Some(i.bumpId) - case x: MapProjection => Some(x.name.bumpId) - case _ => None - } - val name = alias.map(_.name) getOrElse { inputText.trim } - - def makeSureIsNotUnaliased(state: SemanticState): SemanticCheckResult = - throw new InternalException("Should have been aliased before this step") -} - -object AliasedReturnItem { - def apply(v:LogicalVariable):AliasedReturnItem = AliasedReturnItem(v.copyId, v.copyId)(v.position) -} - -//TODO variable should not be a Variable. A Variable is an expression, and the return item alias isn't -case class AliasedReturnItem(expression: Expression, variable: LogicalVariable)(val position: InputPosition) extends ReturnItem { - val alias = Some(variable) - val name = variable.name - - def makeSureIsNotUnaliased(state: SemanticState): SemanticCheckResult = success(state) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/SetItem.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/SetItem.scala deleted file mode 100644 index 2132759094f87..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/SetItem.scala +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticAnalysisTooling, SemanticCheckable, SemanticExpressionCheck} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions._ - -sealed trait SetItem extends ASTNode with SemanticCheckable - -case class SetLabelItem(variable: Variable, labels: Seq[LabelName])(val position: InputPosition) extends SetItem { - def semanticCheck = - SemanticExpressionCheck.simple(variable) chain - SemanticExpressionCheck.expectType(CTNode.covariant, variable) -} - -sealed trait SetProperty extends SetItem with SemanticAnalysisTooling - -case class SetPropertyItem(property: LogicalProperty, expression: Expression)(val position: InputPosition) extends SetProperty { - def semanticCheck = - SemanticExpressionCheck.simple(property) chain - SemanticExpressionCheck.simple(expression) chain - expectType(CTNode.covariant | CTRelationship.covariant, property.map) -} - -case class SetExactPropertiesFromMapItem(variable: Variable, expression: Expression) - (val position: InputPosition) extends SetProperty { - def semanticCheck = - SemanticExpressionCheck.simple(variable) chain - expectType(CTNode.covariant | CTRelationship.covariant, variable) chain - SemanticExpressionCheck.simple(expression) chain - expectType(CTMap.covariant, expression) -} - -case class SetIncludingPropertiesFromMapItem(variable: Variable, expression: Expression) - (val position: InputPosition) extends SetProperty { - def semanticCheck = - SemanticExpressionCheck.simple(variable) chain - expectType(CTNode.covariant | CTRelationship.covariant, variable) chain - SemanticExpressionCheck.simple(expression) chain - expectType(CTMap.covariant, expression) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/SingleGraphAs.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/SingleGraphAs.scala deleted file mode 100644 index 15e78f719de11..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/SingleGraphAs.scala +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition} -import org.neo4j.cypher.internal.frontend.v3_5.SemanticCheck -import org.neo4j.cypher.internal.frontend.v3_5.semantics._ -import org.neo4j.cypher.internal.v3_5.expressions.{Pattern, Variable} - -sealed trait SingleGraphAs extends ASTNode with SemanticCheckable with SemanticAnalysisTooling { - - def as: Option[Variable] - - def generated: Boolean - - def name(context: Option[ContextGraphs]): Option[String] = as.map(_.name) - - def isUnboundContextGraph: Boolean = false - - def withNewName(newName: Variable): SingleGraphAs - def asGenerated: SingleGraphAs - - override def semanticCheck: SemanticCheck = SemanticCheckResult.success - - def declareGraph: SemanticCheck = - semanticCheckFold(as)(v => if (generated) declareGraphMarkedAsGenerated(v) else declareGraph(v)) - - def implicitGraph(context: Option[ContextGraphs]): SemanticCheck = SemanticCheckResult.success -} - -sealed trait BoundGraphAs extends SingleGraphAs - -sealed trait BoundContextGraphAs extends BoundGraphAs { - - override def isUnboundContextGraph: Boolean = as.isEmpty - - protected def contextGraphName: String - - override def declareGraph: SemanticCheck = as match { - case Some(v) => if (generated) declareGraphMarkedAsGenerated(v) else declareGraph(v) - case None => SemanticCheckResult.success - } - - override def implicitGraph(context: Option[ContextGraphs]): SemanticCheck = as match { - case Some(_) => - SemanticCheckResult.success - case None => - val check = (_: SemanticState).implicitContextGraph(context.map(_.source), position, contextGraphName) - check - } -} - -final case class SourceGraphAs(as: Option[Variable], generated: Boolean = false)(val position: InputPosition) extends BoundContextGraphAs { - override protected def contextGraphName: String = "source graph" - override def name(context: Option[ContextGraphs]): Option[String] = super.name(context) orElse context.map(_.source) - override def withNewName(newName: Variable): SourceGraphAs = copy(as = Some(newName))(position) - override def asGenerated: SourceGraphAs = copy(generated = true)(position) -} - -final case class TargetGraphAs(as: Option[Variable], generated: Boolean = false)(val position: InputPosition) extends BoundContextGraphAs { - override protected def contextGraphName: String = "target graph" - override def name(context: Option[ContextGraphs]): Option[String] = super.name(context) orElse context.map(_.target) - override def withNewName(newName: Variable): TargetGraphAs = copy(as = Some(newName))(position) - override def asGenerated: TargetGraphAs = copy(generated = true)(position) -} - -final case class GraphAs(ref: Variable, as: Option[Variable], generated: Boolean = false)(val position: InputPosition) - extends BoundGraphAs { - - override def withNewName(newName: Variable): GraphAs = copy(as = Some(newName))(position) - override def asGenerated: GraphAs = copy(generated = true)(position) - - override def semanticCheck: SemanticCheck = SemanticExpressionCheck.ensureGraphDefined(ref) - override def declareGraph: SemanticCheck = semanticCheckFold(as)(v => implicitGraph(v)) -} - -sealed trait NewGraphAs extends SingleGraphAs - -final case class GraphOfAs(of: Pattern, as: Option[Variable], generated: Boolean = false)(val position: InputPosition) - extends NewGraphAs { - - override def withNewName(newName: Variable): GraphOfAs = copy(as = Some(newName))(position) - override def asGenerated: GraphOfAs = copy(generated = true)(position) - - override def semanticCheck: SemanticCheck = SemanticPatternCheck.check(Pattern.SemanticContext.GraphOf, of) -} - -final case class GraphAtAs(at: GraphUrl, as: Option[Variable], generated: Boolean = false)(val position: InputPosition) - extends NewGraphAs { - - override def withNewName(newName: Variable): GraphAtAs = copy(as = Some(newName))(position) - override def asGenerated: GraphAtAs = copy(generated = true)(position) - - override def semanticCheck: SemanticCheck = at.semanticCheck -} - diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Skip.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Skip.scala deleted file mode 100644 index 749a86f9fa850..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Skip.scala +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition} -import org.neo4j.cypher.internal.v3_5.expressions.Expression - -case class Skip(expression: Expression)(val position: InputPosition) extends ASTNode with ASTSlicingPhrase { - override def name = "SKIP" // ASTSlicingPhrase name -} - diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Statement.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Statement.scala deleted file mode 100644 index 5c8151f73607e..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Statement.scala +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.ASTNode -import org.neo4j.cypher.internal.frontend.v3_5.SemanticCheck - -trait Statement extends ASTNode { - def semanticCheck: SemanticCheck - - def returnColumns: List[String] -} - diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Where.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Where.scala deleted file mode 100644 index 58b478c98cb91..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/Where.scala +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticCheckable, SemanticExpressionCheck} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.Expression - -case class Where(expression: Expression)(val position: InputPosition) - extends ASTNode with SemanticCheckable { - - def dependencies = expression.dependencies - - def semanticCheck = - SemanticExpressionCheck.simple(expression) chain - SemanticExpressionCheck.expectType(CTBoolean.covariant, expression) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/StatementCondition.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/StatementCondition.scala deleted file mode 100644 index 1db567fe2a097..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/StatementCondition.scala +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.conditions - -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.RewriterCondition -import org.neo4j.cypher.internal.frontend.v3_5.phases.{BaseState, Condition} - -case class StatementCondition(inner: Any => Seq[String]) extends Condition { - override def check(state: AnyRef): Seq[String] = state match { - case s: BaseState => inner(s.statement()) - case x => throw new IllegalArgumentException(s"Unknown state: $x") - } -} - -object StatementCondition { - def apply(inner: RewriterCondition) = new StatementCondition(inner.condition) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/aggregationsAreIsolated.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/aggregationsAreIsolated.scala deleted file mode 100644 index e016254c4b999..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/aggregationsAreIsolated.scala +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.conditions - -import org.neo4j.cypher.internal.util.v3_5.Foldable.FoldableAny -import org.neo4j.cypher.internal.frontend.v3_5.ast.hasAggregateButIsNotAggregate -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.Condition -import org.neo4j.cypher.internal.v3_5.expressions.Expression - -case object aggregationsAreIsolated extends Condition { - - def apply(that: Any): Seq[String] = that.treeFold(Seq.empty[String]) { - case expr: Expression if hasAggregateButIsNotAggregate(expr) => - acc => (acc :+ s"Expression $expr contains child expressions which are aggregations", None) - } - - override def name: String = productPrefix -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/collectNodesOfType.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/collectNodesOfType.scala deleted file mode 100644 index f3930608f34ab..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/collectNodesOfType.scala +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.conditions - -import org.neo4j.cypher.internal.util.v3_5.ASTNode -import org.neo4j.cypher.internal.util.v3_5.Foldable.FoldableAny - -import scala.reflect.ClassTag - -case class collectNodesOfType[T <: ASTNode](implicit tag: ClassTag[T]) extends (Any => Seq[T]) { - def apply(that: Any): Seq[T] = that.fold(Seq.empty[T]) { - case node: ASTNode if node.getClass == tag.runtimeClass => - (acc) => acc :+ node.asInstanceOf[T] - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/containsNoMatchingNodes.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/containsNoMatchingNodes.scala deleted file mode 100644 index 1e4b267b6983e..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/containsNoMatchingNodes.scala +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.conditions - -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition} -import org.neo4j.cypher.internal.util.v3_5.Foldable.FoldableAny - -case class containsNoMatchingNodes(matcher: PartialFunction[ASTNode, String]) extends (Any => Seq[String]) { - - def apply(that: Any): Seq[String] = { - that.fold(Seq.empty[(String, InputPosition)]) { - case node: ASTNode if matcher.isDefinedAt(node) => - (acc) => acc :+ ((matcher(node), node.position)) - }.map{ case (name, position) => s"Expected none but found $name at position $position" } - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/containsNoNodesOfType.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/containsNoNodesOfType.scala deleted file mode 100644 index 39855523eaf25..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/containsNoNodesOfType.scala +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.conditions - -import org.neo4j.cypher.internal.util.v3_5.ASTNode -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.Condition - -import scala.reflect.ClassTag - -case class containsNoNodesOfType[T <: ASTNode](implicit tag: ClassTag[T]) extends Condition { - def apply(that: Any): Seq[String] = collectNodesOfType[T].apply(that).map { - node => s"Expected none but found ${node.getClass.getSimpleName} at position ${node.position}" - } - - override def name = s"$productPrefix[${tag.runtimeClass.getSimpleName}]" -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/containsNoReturnAll.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/containsNoReturnAll.scala deleted file mode 100644 index 631fc4f5df044..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/containsNoReturnAll.scala +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.conditions - -import org.neo4j.cypher.internal.frontend.v3_5.ast.ReturnItems -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.Condition - -case object containsNoReturnAll extends Condition { - private val matcher = containsNoMatchingNodes({ - case ri: ReturnItems if ri.includeExisting => "ReturnItems(includeExisting = true, ...)" - }) - def apply(that: Any) = matcher(that) - - override def name: String = productPrefix -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noDuplicatesInReturnItems.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noDuplicatesInReturnItems.scala deleted file mode 100644 index 0026abcf9481e..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noDuplicatesInReturnItems.scala +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.conditions - -import org.neo4j.cypher.internal.frontend.v3_5.ast.ReturnItems -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.Condition - -case object noDuplicatesInReturnItems extends Condition { - def apply(that: Any): Seq[String] = { - val returnItems = collectNodesOfType[ReturnItems].apply(that) - returnItems.collect { - case ris@ReturnItems(_, items) if items.toSet.size != items.size => - s"ReturnItems at ${ris.position} contain duplicate return item: $ris" - } - } - - override def name: String = productPrefix -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noReferenceEqualityAmongVariables.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noReferenceEqualityAmongVariables.scala deleted file mode 100644 index 9606b396825e5..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noReferenceEqualityAmongVariables.scala +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.conditions - -import org.neo4j.cypher.internal.util.v3_5.Ref -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.Condition -import org.neo4j.cypher.internal.v3_5.expressions.Variable - -case object noReferenceEqualityAmongVariables extends Condition { - def apply(that: Any): Seq[String] = { - val ids = collectNodesOfType[Variable].apply(that).map(Ref[Variable]) - ids.groupBy(x => x).collect { - case (id, others) if others.size > 1 => s"The instance ${id.value} is used ${others.size} times" - }.toIndexedSeq - } - - override def name: String = productPrefix -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noUnnamedGraphs.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noUnnamedGraphs.scala deleted file mode 100644 index 1ce31d228ab65..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noUnnamedGraphs.scala +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.conditions - -import org.neo4j.cypher.internal.frontend.v3_5.ast.SingleGraphAs -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.Condition - -case object noUnnamedGraphs extends Condition { - def apply(that: Any): Seq[String] = { - val graphs = collectNodesOfType[SingleGraphAs].apply(that) - val unnamed = graphs.filter(_.as.isEmpty) - unnamed.map { graphDef => s"GraphDef at ${graphDef.position} is unnamed" } - } - - override def name: String = productPrefix -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noUnnamedPatternElementsInGraphOf.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noUnnamedPatternElementsInGraphOf.scala deleted file mode 100644 index 74f34839de8f2..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noUnnamedPatternElementsInGraphOf.scala +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.conditions - -import org.neo4j.cypher.internal.frontend.v3_5.ast.GraphOfAs -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.Condition -import org.neo4j.cypher.internal.v3_5.expressions.{NodePattern, RelationshipPattern} - -case object noUnnamedPatternElementsInGraphOf extends Condition { - def apply(that: Any): Seq[String] = { - val into = collectNodesOfType[GraphOfAs].apply(that).map(_.of) - into.flatMap(unnamedNodePatterns) ++ into.flatMap(unnamedRelationshipPatterns) - } - - private def unnamedRelationshipPatterns(that: Any): Seq[String] = { - collectNodesOfType[RelationshipPattern].apply(that).collect { - case rel@RelationshipPattern(None, _, _, _, _, _) => - s"RelationshipPattern at ${rel.position} is unnamed" - } - } - - private def unnamedNodePatterns(that: Any): Seq[String] = { - collectNodesOfType[NodePattern].apply(that).collect { - case node@NodePattern(None, _, _) => - s"NodePattern at ${node.position} is unnamed" - } - } - - override def name: String = productPrefix -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noUnnamedPatternElementsInMatch.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noUnnamedPatternElementsInMatch.scala deleted file mode 100644 index 973311f5e3739..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noUnnamedPatternElementsInMatch.scala +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.conditions - -import org.neo4j.cypher.internal.frontend.v3_5.ast.Match -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.Condition -import org.neo4j.cypher.internal.v3_5.expressions.{NodePattern, RelationshipPattern} - -case object noUnnamedPatternElementsInMatch extends Condition { - def apply(that: Any): Seq[String] = { - val into = collectNodesOfType[Match].apply(that).map(_.pattern) - into.flatMap(unnamedNodePatterns) ++ into.flatMap(unnamedRelationshipPatterns) - } - - private def unnamedRelationshipPatterns(that: Any): Seq[String] = { - collectNodesOfType[RelationshipPattern].apply(that).collect { - case rel@RelationshipPattern(None, _, _, _, _, _) => - s"RelationshipPattern at ${rel.position} is unnamed" - } - } - - private def unnamedNodePatterns(that: Any): Seq[String] = { - collectNodesOfType[NodePattern].apply(that).collect { - case node@NodePattern(None, _, _) => - s"NodePattern at ${node.position} is unnamed" - } - } - - override def name: String = productPrefix -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noUnnamedPatternElementsInPatternComprehension.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noUnnamedPatternElementsInPatternComprehension.scala deleted file mode 100644 index 883379925431c..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/noUnnamedPatternElementsInPatternComprehension.scala +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.conditions - -import org.neo4j.cypher.internal.util.v3_5.Foldable.FoldableAny -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.Condition -import org.neo4j.cypher.internal.v3_5.expressions.{PatternComprehension, PatternElement, RelationshipsPattern} - -case object noUnnamedPatternElementsInPatternComprehension extends Condition { - - override def name: String = productPrefix - - override def apply(that: Any): Seq[String] = that.treeFold(Seq.empty[String]) { - case expr: PatternComprehension if containsUnNamedPatternElement(expr.pattern) => - acc => (acc :+ s"Expression $expr contains pattern elements which are not named", None) - } - - private def containsUnNamedPatternElement(expr: RelationshipsPattern) = expr.treeExists { - case p: PatternElement => p.variable.isEmpty - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/normalizedEqualsArguments.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/normalizedEqualsArguments.scala deleted file mode 100644 index 58aaaae4c3a05..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/normalizedEqualsArguments.scala +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.conditions - -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.Condition -import org.neo4j.cypher.internal.v3_5.expressions.{Equals, Expression, FunctionInvocation, Property} -import org.neo4j.cypher.internal.v3_5.functions - -case object normalizedEqualsArguments extends Condition { - def apply(that: Any): Seq[String] = { - val equals = collectNodesOfType[Equals].apply(that) - equals.collect { - case eq@Equals(expr, Property(_,_)) if !expr.isInstanceOf[Property] && notIdFunction(expr) => - s"Equals at ${eq.position} is not normalized: $eq" - case eq@Equals(expr, func@FunctionInvocation(_, _, _, _)) if isIdFunction(func) && notIdFunction(expr) => - s"Equals at ${eq.position} is not normalized: $eq" - } - } - - private def isIdFunction(func: FunctionInvocation) = func.function == functions.Id - - private def notIdFunction(expr: Expression) = - !expr.isInstanceOf[FunctionInvocation] || !isIdFunction(expr.asInstanceOf[FunctionInvocation]) - - override def name: String = productPrefix -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/orderByOnlyOnVariables.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/orderByOnlyOnVariables.scala deleted file mode 100644 index c2048ae22aba7..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/conditions/orderByOnlyOnVariables.scala +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.conditions - -import org.neo4j.cypher.internal.frontend.v3_5.ast.{OrderBy, SortItem} -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.Condition -import org.neo4j.cypher.internal.v3_5.expressions.Variable - -case object orderByOnlyOnVariables extends Condition { - def apply(that: Any): Seq[String] = { - val orderBys = collectNodesOfType[OrderBy].apply(that) - orderBys.flatMap { orderBy => - orderBy.sortItems.collect { - case item: SortItem if !item.expression.isInstanceOf[Variable] => - s"OrderBy at ${orderBy.position} is ordering on an expression (${item.expression}) instead of a variable" - } - } - } - - override def name: String = productPrefix -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/connectedComponents.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/connectedComponents.scala deleted file mode 100644 index 3d43b35e9d822..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/connectedComponents.scala +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.v3_5.expressions.{LogicalVariable, NodePattern, PatternPart} - -import scala.annotation.tailrec -import scala.collection.immutable - -/* - * Helper function that finds connected components in patterns. - */ -object connectedComponents { - - type ComponentPart = Set[LogicalVariable] - type ConnectedComponent = Set[ComponentPart] - - //enable using the companion objects of the type aliases, - //e.g. `ComponentPart(Variable("a"), Variable("b"),...)` - val ComponentPart = Set - val ConnectedComponent = Set - - def apply(patternParts: Seq[PatternPart]): IndexedSeq[ConnectedComponent] = { - val parts: immutable.IndexedSeq[ComponentPart] = patternParts.map(_.fold(Set.empty[LogicalVariable]) { - case NodePattern(Some(id), _, _) => list => list + id - }).toIndexedSeq - - this.apply(parts) - } - - def apply(parts: IndexedSeq[ComponentPart]): IndexedSeq[ConnectedComponent] = { - - @tailrec - def loop(remaining: IndexedSeq[ComponentPart], connectedComponents: IndexedSeq[ConnectedComponent]): IndexedSeq[ConnectedComponent] = { - if (remaining.isEmpty) connectedComponents - else { - val part = remaining.head - - val newConnected = connectedComponents.zipWithIndex.collectFirst { - case (cc, index) if cc connectedTo part => connectedComponents.updated(index, cc + part) - } getOrElse connectedComponents :+ ConnectedComponent(part) - - loop(remaining.tail, newConnected) - } - } - loop(parts, IndexedSeq.empty) - } - - implicit class RichConnectedComponent(connectedComponent: ConnectedComponent) { - - def connectedTo(part: ComponentPart) = connectedComponent.exists(c => (c intersect part).nonEmpty) - - def variables: Set[LogicalVariable] = connectedComponent.flatten - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/hasAggregateButIsNotAggregate.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/hasAggregateButIsNotAggregate.scala deleted file mode 100644 index a6a659a7e5029..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/hasAggregateButIsNotAggregate.scala +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, IsAggregate, containsAggregate} - -object hasAggregateButIsNotAggregate extends (Expression => Boolean) { - def apply(expression: Expression): Boolean = expression match { - case IsAggregate(_) => false - case e: Expression => containsAggregate(e) - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/ASTRewriter.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/ASTRewriter.scala deleted file mode 100644 index dab6d1140a211..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/ASTRewriter.scala +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.frontend.v3_5.ast.conditions._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.{Statement, UnaliasedReturnItem} -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.{RewriterCondition, RewriterStepSequencer} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticState -import org.neo4j.cypher.internal.v3_5.expressions.NotEquals - -class ASTRewriter(rewriterSequencer: (String) => RewriterStepSequencer, - literalExtraction: LiteralExtraction, - getDegreeRewriting: Boolean) { - - import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.RewriterStep._ - - def rewrite(queryText: String, statement: Statement, semanticState: SemanticState): (Statement, Map[String, Any], Set[RewriterCondition]) = { - - val contract = rewriterSequencer("ASTRewriter")( - recordScopes(semanticState), - desugarMapProjection(semanticState), - normalizeComparisons, - enableCondition(noReferenceEqualityAmongVariables), - enableCondition(containsNoNodesOfType[UnaliasedReturnItem]), - enableCondition(orderByOnlyOnVariables), - enableCondition(noDuplicatesInReturnItems), - enableCondition(noUnnamedGraphs), - expandStar(semanticState), - enableCondition(containsNoReturnAll), - foldConstants, - nameMatchPatternElements, - nameUpdatingClauses, - enableCondition(noUnnamedPatternElementsInMatch), - nameGraphOfPatternElements, - enableCondition(noUnnamedPatternElementsInGraphOf), - normalizeMatchPredicates(getDegreeRewriting), - normalizeNotEquals, - enableCondition(containsNoNodesOfType[NotEquals]), - normalizeArgumentOrder, - normalizeSargablePredicates, - enableCondition(normalizedEqualsArguments), - addUniquenessPredicates, - isolateAggregation, - enableCondition(aggregationsAreIsolated), - replaceLiteralDynamicPropertyLookups, - namePatternComprehensionPatternElements, - enableCondition(noUnnamedPatternElementsInPatternComprehension), - inlineNamedPathsInPatternComprehensions - ) - - val rewrittenStatement = statement.endoRewrite(contract.rewriter) - val (extractParameters, extractedParameters) = literalReplacement(rewrittenStatement, literalExtraction) - - (rewrittenStatement.endoRewrite(extractParameters), extractedParameters, contract.postConditions) - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/CNFNormalizer.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/CNFNormalizer.scala deleted file mode 100644 index f978178ad68d9..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/CNFNormalizer.scala +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp, inSequence, topDown} -import org.neo4j.cypher.internal.util.v3_5.Foldable._ -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.helpers.fixedPoint -import org.neo4j.cypher.internal.frontend.v3_5.phases.{BaseContext, Condition} -import org.neo4j.cypher.internal.frontend.v3_5._ -import org.neo4j.cypher.internal.v3_5.expressions._ -import org.neo4j.cypher.internal.v3_5.functions.Exists - -case object CNFNormalizer extends StatementRewriter { - - override def description: String = "normalize boolean predicates into conjunctive normal form" - - override def instance(context: BaseContext): Rewriter = { - implicit val monitor = context.monitors.newMonitor[AstRewritingMonitor]() - inSequence( - deMorganRewriter(), - distributeLawsRewriter(), - flattenBooleanOperators, - simplifyPredicates, - // Redone here since CNF normalization might introduce negated inequalities (which this removes) - normalizeSargablePredicates - ) - } - - override def postConditions: Set[Condition] = Set.empty -} - -case class deMorganRewriter()(implicit monitor: AstRewritingMonitor) extends Rewriter { - - def apply(that: AnyRef): AnyRef = instance(that) - - private val step = Rewriter.lift { - case p@Xor(expr1, expr2) => - And(Or(expr1, expr2)(p.position), Not(And(expr1.endoRewrite(copyVariables), expr2.endoRewrite(copyVariables))(p.position))(p.position))(p.position) - case p@Not(And(exp1, exp2)) => - Or(Not(exp1)(p.position), Not(exp2)(p.position))(p.position) - case p@Not(Or(exp1, exp2)) => - And(Not(exp1)(p.position), Not(exp2)(p.position))(p.position) - } - - private val instance: Rewriter = repeatWithSizeLimit(bottomUp(step))(monitor) -} - -object distributeLawsRewriter { - // converting from DNF to CNF is exponentially expensive, so we only do it for a small amount of clauses - // see https://en.wikipedia.org/wiki/Conjunctive_normal_form#Conversion_into_CNF - val DNF_CONVERSION_LIMIT = 8 -} - -case class distributeLawsRewriter()(implicit monitor: AstRewritingMonitor) extends Rewriter { - def apply(that: AnyRef): AnyRef = { - if (dnfCounts(that) < distributeLawsRewriter.DNF_CONVERSION_LIMIT) - instance(that) - else { - monitor.abortedRewritingDueToLargeDNF(that) - that - } - } - - private def dnfCounts(value: Any) = value.treeFold(1) { - case Or(lhs, a: And) => acc => (acc + 1, Some(identity)) - case Or(a: And, rhs) => acc => (acc + 1, Some(identity)) - } - - private val step = Rewriter.lift { - case p@Or(exp1, And(exp2, exp3)) => And(Or(exp1, exp2)(p.position), Or(exp1.endoRewrite(copyVariables), exp3)(p.position))(p.position) - case p@Or(And(exp1, exp2), exp3) => And(Or(exp1, exp3)(p.position), Or(exp2, exp3.endoRewrite(copyVariables))(p.position))(p.position) - } - - private val instance: Rewriter = repeatWithSizeLimit(bottomUp(step))(monitor) -} - -object flattenBooleanOperators extends Rewriter { - def apply(that: AnyRef): AnyRef = instance.apply(that) - - private val firstStep: Rewriter = Rewriter.lift { - case p@And(lhs, rhs) => Ands(Set(lhs, rhs))(p.position) - case p@Or(lhs, rhs) => Ors(Set(lhs, rhs))(p.position) - } - - private val secondStep: Rewriter = Rewriter.lift { - case p@Ands(exprs) => Ands(exprs.flatMap { - case Ands(inner) => inner - case x => Set(x) - })(p.position) - case p@Ors(exprs) => Ors(exprs.flatMap { - case Ors(inner) => inner - case x => Set(x) - })(p.position) - } - - private val instance = inSequence(bottomUp(firstStep), fixedPoint(bottomUp(secondStep))) -} - -object simplifyPredicates extends Rewriter { - def apply(that: AnyRef): AnyRef = instance.apply(that) - - private val T = True()(null) - private val F = False()(null) - - private val step: Rewriter = Rewriter.lift { - case Not(Not(exp)) => exp - case p@Ands(exps) if exps.size == 1 => exps.head - case p@Ors(exps) if exps.size == 1 => exps.head - case p@Ands(exps) if exps.contains(T) => Ands(exps.filterNot(T == _))(p.position) - case p@Ors(exps) if exps.contains(F) => Ors(exps.filterNot(F == _))(p.position) - case p@Ors(exps) if exps.contains(T) => True()(p.position) - case p@Ands(exps) if exps.contains(F) => False()(p.position) - } - - private val instance = fixedPoint(bottomUp(step)) -} - -case object normalizeSargablePredicates extends Rewriter { - - override def apply(that: AnyRef): AnyRef = instance(that) - - private val instance: Rewriter = topDown(Rewriter.lift { - - // turn n.prop IS NOT NULL into exists(n.prop) - case predicate@IsNotNull(property@Property(_, _)) => - Exists.asInvocation(property)(predicate.position) - - // remove not from inequality expressions by negating them - case Not(inequality: InequalityExpression) => - inequality.negated - }) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/LabelPredicateNormalizer.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/LabelPredicateNormalizer.scala deleted file mode 100644 index 2f2559bb48281..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/LabelPredicateNormalizer.scala +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, HasLabels, NodePattern} - -object LabelPredicateNormalizer extends MatchPredicateNormalizer { - override val extract: PartialFunction[AnyRef, IndexedSeq[Expression]] = { - case p@NodePattern(Some(id), labels, _) if labels.nonEmpty => Vector(HasLabels(id.copyId, labels)(p.position)) - } - - override val replace: PartialFunction[AnyRef, AnyRef] = { - case p@NodePattern(Some(id), labels, _) if labels.nonEmpty => p.copy(variable = Some(id.copyId), labels = Seq.empty)(p.position) - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/MatchPredicateNormalization.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/MatchPredicateNormalization.scala deleted file mode 100644 index d22000a34ddb5..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/MatchPredicateNormalization.scala +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{InputPosition, Rewriter, topDown} -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.helpers.calculateUsingGetDegree -import org.neo4j.cypher.internal.v3_5.expressions._ - -abstract class MatchPredicateNormalization(normalizer: MatchPredicateNormalizer, getDegreeRewriting: Boolean) extends Rewriter { - - def apply(that: AnyRef): AnyRef = instance(that) - - private val rewriter = Rewriter.lift { - case m@Match(_, pattern, _, where) => - val predicates = pattern.fold(Vector.empty[Expression]) { - case pattern: AnyRef if normalizer.extract.isDefinedAt(pattern) => acc => acc ++ normalizer.extract(pattern) - case _ => identity - } - - val rewrittenPredicates: List[Expression] = (predicates ++ where.map(_.expression)).toList - - val predOpt: Option[Expression] = rewrittenPredicates match { - case Nil => None - case exp :: Nil => Some(exp) - case list => Some(list.reduce(And(_, _)(m.position))) - } - - val newWhere: Option[Where] = predOpt.map { - exp => - val pos: InputPosition = where.fold(m.position)(_.position) - val e = if (getDegreeRewriting) - exp.endoRewrite(whereRewriter) - else - exp - Where(e)(pos) - } - - m.copy( - pattern = pattern.endoRewrite(topDown(Rewriter.lift(normalizer.replace))), - where = newWhere - )(m.position) - } - - private def whereRewriter: Rewriter = Rewriter.lift { - // WHERE (a)-[:R]->() to WHERE GetDegree( (a)-[:R]->()) > 0 - case p@PatternExpression(RelationshipsPattern(RelationshipChain(NodePattern(Some(node), List(), None), - RelationshipPattern(None, types, None, None, dir, _), - NodePattern(None, List(), None)))) => - GreaterThan(calculateUsingGetDegree(p, node, types, dir), SignedDecimalIntegerLiteral("0")(p.position))(p.position) - // WHERE ()-[:R]->(a) to WHERE GetDegree( (a)<-[:R]-()) > 0 - case p@PatternExpression(RelationshipsPattern(RelationshipChain(NodePattern(None, List(), None), - RelationshipPattern(None, types, None, None, dir, _), - NodePattern(Some(node), List(), None)))) => - GreaterThan(calculateUsingGetDegree(p, node, types, dir.reversed), SignedDecimalIntegerLiteral("0")(p.position))(p.position) - - case a@And(lhs, rhs) => - And(lhs.endoRewrite(whereRewriter), rhs.endoRewrite(whereRewriter))(a.position) - - case o@Or(lhs, rhs) => Or(lhs.endoRewrite(whereRewriter), rhs.endoRewrite(whereRewriter))(o.position) - - case n@Not(e) => Not(e.endoRewrite(whereRewriter))(n.position) - } - - private val instance = topDown(rewriter, _.isInstanceOf[Expression]) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/MatchPredicateNormalizer.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/MatchPredicateNormalizer.scala deleted file mode 100644 index aa62d5fb27336..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/MatchPredicateNormalizer.scala +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.v3_5.expressions.Expression - -trait MatchPredicateNormalizer { - val extract: PartialFunction[AnyRef, IndexedSeq[Expression]] - val replace: PartialFunction[AnyRef, AnyRef] -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/MatchPredicateNormalizerChain.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/MatchPredicateNormalizerChain.scala deleted file mode 100644 index f69d74093700c..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/MatchPredicateNormalizerChain.scala +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.v3_5.expressions.Expression -import org.neo4j.cypher.internal.frontend.v3_5.helpers.PartialFunctionSupport - -case class MatchPredicateNormalizerChain(normalizers: MatchPredicateNormalizer*) extends MatchPredicateNormalizer { - val extract = PartialFunctionSupport.reduceAnyDefined(normalizers.map(_.extract))(IndexedSeq.empty[Expression])(_ ++ _) - val replace = PartialFunctionSupport.composeIfDefined(normalizers.map(_.replace)) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/Namespacer.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/Namespacer.scala deleted file mode 100644 index 17c0a2147bd28..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/Namespacer.scala +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{Ref, Rewriter, bottomUp, inSequence} -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase -import org.neo4j.cypher.internal.frontend.v3_5.phases.{BaseContext, BaseState, Condition, Phase} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{Scope, SemanticTable, SymbolUse} -import org.neo4j.cypher.internal.v3_5.expressions.{LogicalVariable, ProcedureOutput, Variable} - -object Namespacer extends Phase[BaseContext, BaseState, BaseState] { - type VariableRenamings = Map[Ref[Variable], Variable] - - import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.AST_REWRITE - - override def phase: CompilationPhase = AST_REWRITE - - override def description: String = "rename variables so they are all unique" - - override def process(from: BaseState, ignored: BaseContext): BaseState = { - val ambiguousNames = shadowedNames(from.semantics().scopeTree) - val variableDefinitions: Map[SymbolUse, SymbolUse] = from.semantics().scopeTree.allVariableDefinitions - val protectedVariables = returnAliases(from.statement()) - val renamings = variableRenamings(from.statement(), variableDefinitions, ambiguousNames, protectedVariables) - - val rewriter = renamingRewriter(renamings) - val newStatement = from.statement().endoRewrite(rewriter) - val table = SemanticTable(types = from.semantics().typeTable, recordedScopes = from.semantics().recordedScopes) - - val newSemanticTable = table.replaceExpressions(rewriter) - from.withStatement(newStatement).withSemanticTable(newSemanticTable) - } - - override def postConditions: Set[Condition] = Set.empty - - private def shadowedNames(scopeTree: Scope): Set[String] = { - val definitions = scopeTree.allSymbolDefinitions - - definitions.collect { - case (name, symbolDefinitions) if symbolDefinitions.size > 1 => name - }.toSet - } - - private def returnAliases(statement: Statement): Set[Ref[LogicalVariable]] = - statement.treeFold(Set.empty[Ref[LogicalVariable]]) { - - case With(_, _, GraphReturnItems(_, items), _, _, _, _) => - val gVars = extractGraphVars(items) - acc => (acc ++ gVars, Some(identity)) - - // ignore variable in StartItem that represents index names and key names - case Return(_, ReturnItems(_, items), graphItems, _, _, _, _) => - val variables = items.map(_.alias.map(Ref[LogicalVariable]).get) - val gVars = graphItems.map(_.items).map(extractGraphVars).getOrElse(Seq.empty) - acc => (acc ++ variables ++ gVars, Some(identity)) - } - - private def extractGraphVars(items: Seq[GraphReturnItem]): Seq[Ref[LogicalVariable]] = { - items.flatMap { item => - item.graphs.flatMap { - case g: GraphAs => - Seq(g.ref, g.as.get).map(Ref[Variable]) - case x => - x.as.map(Ref[Variable]) - } - } - } - - private def variableRenamings(statement: Statement, variableDefinitions: Map[SymbolUse, SymbolUse], - ambiguousNames: Set[String], protectedVariables: Set[Ref[LogicalVariable]]): VariableRenamings = - statement.treeFold(Map.empty[Ref[Variable], Variable]) { - case i: Variable if ambiguousNames(i.name) && !protectedVariables(Ref(i)) => - val symbolDefinition = variableDefinitions(SymbolUse(i)) - val newVariable = i.renameId(s" ${symbolDefinition.nameWithPosition}") - val renaming = Ref(i) -> newVariable - acc => (acc + renaming, Some(identity)) - } - - private def renamingRewriter(renamings: VariableRenamings): Rewriter = inSequence( - bottomUp(Rewriter.lift { - case item@ProcedureResultItem(None, v: Variable) if renamings.contains(Ref(v)) => - item.copy(output = Some(ProcedureOutput(v.name)(v.position)))(item.position) - }), - bottomUp(Rewriter.lift { - case v: Variable => - renamings.get(Ref(v)) match { - case Some(newVariable) => newVariable - case None => v - } - })) - -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/PatternExpressionPatternElementNamer.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/PatternExpressionPatternElementNamer.scala deleted file mode 100644 index b4a4d8ab9001b..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/PatternExpressionPatternElementNamer.scala +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.IdentityMap -import org.neo4j.cypher.internal.v3_5.expressions._ - -object PatternExpressionPatternElementNamer { - - def apply(expr: PatternExpression): (PatternExpression, Map[PatternElement, Variable]) = { - val unnamedMap = nameUnnamedPatternElements(expr.pattern) - val namedPattern = expr.pattern.endoRewrite(namePatternElementsFromMap(unnamedMap)) - val namedExpr = expr.copy(pattern = namedPattern) - (namedExpr, unnamedMap) - } - - def apply(expr: PatternComprehension): (PatternComprehension, Map[PatternElement, Variable]) = { - val unnamedMap = nameUnnamedPatternElements(expr.pattern) - val namedPattern = expr.pattern.endoRewrite(namePatternElementsFromMap(unnamedMap)) - val namedExpr = expr.copy(pattern = namedPattern)(expr.position) - (namedExpr, unnamedMap) - } - - private def nameUnnamedPatternElements(pattern: RelationshipsPattern): Map[PatternElement, Variable] = { - val unnamedElements = findPatternElements(pattern).filter(_.variable.isEmpty) - IdentityMap(unnamedElements.map { - case elem: NodePattern => - elem -> Variable(NodeNameGenerator.name(elem.position.bumped()))(elem.position) - case elem@RelationshipChain(_, relPattern, _) => - elem -> Variable(RelNameGenerator.name(relPattern.position.bumped()))(relPattern.position) - }: _*) - } - - private case object findPatternElements { - def apply(astNode: ASTNode): Seq[PatternElement] = astNode.treeFold(Seq.empty[PatternElement]) { - case patternElement: PatternElement => - acc => (acc :+ patternElement, Some(identity)) - - case patternExpr: PatternExpression => - acc => (acc, None) - } - } - - private case class namePatternElementsFromMap(map: Map[PatternElement, Variable]) extends Rewriter { - override def apply(that: AnyRef): AnyRef = instance.apply(that) - - private val instance: Rewriter = topDown(Rewriter.lift { - case pattern: NodePattern if map.contains(pattern) => - pattern.copy(variable = Some(map(pattern)))(pattern.position) - case pattern: RelationshipChain if map.contains(pattern) => - val rel = pattern.relationship - pattern.copy(relationship = rel.copy(variable = Some(map(pattern)))(rel.position))(pattern.position) - }) - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/PropertyPredicateNormalizer.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/PropertyPredicateNormalizer.scala deleted file mode 100644 index fc6e5d5b510a5..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/PropertyPredicateNormalizer.scala +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{FreshIdNameGenerator, InputPosition} -import org.neo4j.cypher.internal.v3_5.expressions._ - -object PropertyPredicateNormalizer extends MatchPredicateNormalizer { - override val extract: PartialFunction[AnyRef, IndexedSeq[Expression]] = { - case NodePattern(Some(id), _, Some(props)) if !isParameter(props) => - propertyPredicates(id, props) - - case RelationshipPattern(Some(id), _, None, Some(props), _, _) if !isParameter(props) => - propertyPredicates(id, props) - - case rp@RelationshipPattern(Some(id), _, Some(_), Some(props), _, _) if !isParameter(props) => - Vector(varLengthPropertyPredicates(id, props, rp.position)) - } - - override val replace: PartialFunction[AnyRef, AnyRef] = { - case p@NodePattern(Some(_) ,_, Some(props)) if !isParameter(props) => p.copy(properties = None)(p.position) - case p@RelationshipPattern(Some(_), _, _, Some(props), _, _) if !isParameter(props) => p.copy(properties = None)(p.position) - } - - private def isParameter(expr: Expression) = expr match { - case _: Parameter => true - case _ => false - } - - private def propertyPredicates(id: LogicalVariable, props: Expression): IndexedSeq[Expression] = props match { - case mapProps: MapExpression => - mapProps.items.map { - // MATCH (a {a: 1, b: 2}) => MATCH (a) WHERE a.a = 1 AND a.b = 2 - case (propId, expression) => Equals(Property(id.copyId, propId)(mapProps.position), expression)(mapProps.position) - }.toIndexedSeq - case expr: Expression => - Vector(Equals(id.copyId, expr)(expr.position)) - case _ => - Vector.empty - } - - private def varLengthPropertyPredicates(id: LogicalVariable, props: Expression, patternPosition: InputPosition): Expression = { - val idName = FreshIdNameGenerator.name(patternPosition) - val newId = Variable(idName)(id.position) - val expressions = propertyPredicates(newId, props) - val conjunction = conjunct(expressions) - AllIterablePredicate(newId, id.copyId, Some(conjunction))(props.position) - } - - private def conjunct(exprs: Seq[Expression]): Expression = exprs match { - case Nil => throw new IllegalArgumentException("There should be at least one predicate to be rewritten") - case expr +: Nil => expr - case expr +: tail => And(expr, conjunct(tail))(expr.position) - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/ReturnItemSafeTopDownRewriter.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/ReturnItemSafeTopDownRewriter.scala deleted file mode 100644 index 943de32f8e445..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/ReturnItemSafeTopDownRewriter.scala +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.Foldable.TreeAny -import org.neo4j.cypher.internal.util.v3_5.Rewritable._ -import org.neo4j.cypher.internal.util.v3_5.{InternalException, Rewritable, Rewriter} -import org.neo4j.cypher.internal.frontend.v3_5.ast.AliasedReturnItem -import org.neo4j.cypher.internal.v3_5.expressions.Expression - -import scala.annotation.tailrec -import scala.collection.mutable - -/* -This rewriter is an alternative to the topDown rewriter that does the same thing, -but does not rewrite ReturnItem alias, only the projected expression -*/ -case class ReturnItemSafeTopDownRewriter(inner: Rewriter) extends Rewriter { - - override def apply(that: AnyRef): AnyRef = { - val initialStack = mutable.ArrayStack((List(that), new mutable.MutableList[AnyRef]())) - val result = tailrecApply(initialStack) - assert(result.size == 1) - result.head - } - - @tailrec - private def tailrecApply(stack: mutable.ArrayStack[(List[AnyRef], mutable.MutableList[AnyRef])]): mutable.MutableList[AnyRef] = { - val (currentJobs, _) = stack.top - if (currentJobs.isEmpty) { - val (_, newChildren) = stack.pop() - if (stack.isEmpty) { - newChildren - } else { - stack.pop() match { - case (Nil, _) => throw new InternalException("only to stop warnings. should never happen") - case ((returnItem@AliasedReturnItem(expression, variable)) :: jobs, doneJobs) => - val newExpression = newChildren.head.asInstanceOf[Expression] - val newReturnItem = returnItem.copy(expression = newExpression)(returnItem.position) - stack.push((jobs, doneJobs += newReturnItem)) - case (job :: jobs, doneJobs) => - val doneJob = Rewritable.dupAny(job, newChildren) - stack.push((jobs, doneJobs += doneJob)) - } - - tailrecApply(stack) - } - } else { - val (newJob :: jobs, doneJobs) = stack.pop() - val rewrittenJob = newJob.rewrite(inner) - stack.push((rewrittenJob :: jobs, doneJobs)) - stack.push((rewrittenJob.children.toList, new mutable.MutableList())) - tailrecApply(stack) - } - } - -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/StatementRewriter.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/StatementRewriter.scala deleted file mode 100644 index 88487829dd0d3..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/StatementRewriter.scala +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.Rewriter -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.AST_REWRITE -import org.neo4j.cypher.internal.frontend.v3_5.phases.{BaseContext, BaseState, Phase} - -trait StatementRewriter extends Phase[BaseContext, BaseState, BaseState] { - override def phase: CompilationPhase = AST_REWRITE - - def instance(context: BaseContext): Rewriter - - override def process(from: BaseState, context: BaseContext): BaseState = { - val rewritten = from.statement().endoRewrite(instance(context)) - from.withStatement(rewritten) - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/addUniquenessPredicates.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/addUniquenessPredicates.scala deleted file mode 100644 index 3431da19a2e6b..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/addUniquenessPredicates.scala +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.v3_5.expressions._ - -case object addUniquenessPredicates extends Rewriter { - - def apply(that: AnyRef): AnyRef = instance(that) - - private val rewriter = Rewriter.lift { - case m@Match(_, pattern: Pattern, _, where: Option[Where]) => - val uniqueRels: Seq[UniqueRel] = collectUniqueRels(pattern) - if (uniqueRels.size < 2) { - m - } else { - val newWhere = addPredicate(m, uniqueRels, where) - m.copy(where = newWhere)(m.position) - } - case m@Merge(pattern: Pattern, _, where: Option[Where]) => - val uniqueRels: Seq[UniqueRel] = collectUniqueRels(pattern) - if (uniqueRels.size < 2) { - m - } else { - val newWhere = addPredicate(m, uniqueRels, where) - m.copy(where = newWhere)(m.position) - } - } - - private def addPredicate(clause: Clause, uniqueRels: Seq[UniqueRel], where: Option[Where]): Option[Where] = { - val maybePredicate: Option[Expression] = createPredicateFor(uniqueRels, clause.position) - val newWhere: Option[Where] = (where, maybePredicate) match { - case (Some(oldWhere), Some(newPredicate)) => - Some(oldWhere.copy(expression = And(oldWhere.expression, newPredicate)(clause.position))(clause.position)) - - case (None, Some(newPredicate)) => - Some(Where(expression = newPredicate)(clause.position)) - - case (oldWhere, None) => oldWhere - } - newWhere - } - - private val instance = bottomUp(rewriter, _.isInstanceOf[Expression]) - - def collectUniqueRels(pattern: ASTNode): Seq[UniqueRel] = - pattern.treeFold(Seq.empty[UniqueRel]) { - case _: ShortestPaths => - acc => (acc, None) - - case RelationshipChain(_, patRel@RelationshipPattern(optIdent, types, _, _, _, _), _) => - acc => { - val ident = optIdent.getOrElse(throw new InternalException("This rewriter cannot work with unnamed patterns")) - (acc :+ UniqueRel(ident, types.toSet, patRel.isSingleLength), Some(identity)) - } - } - - private def createPredicateFor(uniqueRels: Seq[UniqueRel], pos: InputPosition): Option[Expression] = { - createPredicatesFor(uniqueRels, pos).reduceOption(And(_, _)(pos)) - } - - def createPredicatesFor(uniqueRels: Seq[UniqueRel], pos: InputPosition): Seq[Expression] = - for { - x <- uniqueRels - y <- uniqueRels if x.name < y.name && !x.isAlwaysDifferentFrom(y) - } yield { - val equals = Equals(x.variable.copyId, y.variable.copyId)(pos) - - (x.singleLength, y.singleLength) match { - case (true, true) => - Not(equals)(pos) - - case (true, false) => - NoneIterablePredicate(y.variable.copyId, y.variable.copyId, Some(equals))(pos) - - case (false, true) => - NoneIterablePredicate(x.variable.copyId, x.variable.copyId, Some(equals))(pos) - - case (false, false) => - NoneIterablePredicate(x.variable.copyId, x.variable.copyId, Some(AnyIterablePredicate(y.variable.copyId, y.variable.copyId, Some(equals))(pos)))(pos) - } - } - - case class UniqueRel(variable: LogicalVariable, types: Set[RelTypeName], singleLength: Boolean) { - def name = variable.name - - def isAlwaysDifferentFrom(other: UniqueRel) = - types.nonEmpty && other.types.nonEmpty && (types intersect other.types).isEmpty - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/collapseMultipleInPredicates.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/collapseMultipleInPredicates.scala deleted file mode 100644 index 76163cc6bb572..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/collapseMultipleInPredicates.scala +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, In, ListLiteral, Ors} - -import scala.collection.immutable.Iterable - -/* -This class merges multiple IN predicates into larger ones. -These can later be turned into index lookups or node-by-id ops - */ -case object collapseMultipleInPredicates extends Rewriter { - - override def apply(that: AnyRef) = instance(that) - - case class InValue(lhs: Expression, expr: Expression) - - private val instance: Rewriter = bottomUp(Rewriter.lift { - case predicate@Ors(exprs) => - // Find all the expressions we want to rewrite - val (const: Seq[Expression], nonRewritable: Seq[Expression]) = exprs.toList.partition { - case in@In(_, rhs: ListLiteral) => true - case _ => false - } - - // For each expression on the RHS of any IN, produce a InValue place holder - val ins: Seq[InValue] = const.flatMap { - case In(lhs, rhs: ListLiteral) => - rhs.expressions.map(expr => InValue(lhs, expr)) - } - - // Find all IN against the same predicate and rebuild the collection with all available values - val groupedINPredicates = ins.groupBy(_.lhs) - val flattenConst: Iterable[In] = groupedINPredicates.map { - case (lhs, values) => - val pos = lhs.position - In(lhs, ListLiteral(values.map(_.expr).toIndexedSeq)(pos))(pos) - } - - // Return the original non-rewritten predicates with our new ones - nonRewritable ++ flattenConst match { - case head :: Nil => head - case l => Ors(l.toSet)(predicate.position) - } - }) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/copyVariables.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/copyVariables.scala deleted file mode 100644 index 3e0f40abb573b..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/copyVariables.scala +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.v3_5.expressions.Variable - -case object copyVariables extends Rewriter { - private val instance = bottomUp(Rewriter.lift { case variable: Variable => variable.copyId }) - - def apply(that: AnyRef): AnyRef = instance.apply(that) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/createGraphIntroducesHorizon.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/createGraphIntroducesHorizon.scala deleted file mode 100644 index 8e49d43f79a6a..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/createGraphIntroducesHorizon.scala +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.frontend.v3_5.ast._ - -case object createGraphIntroducesHorizon extends Rewriter { - - def apply(that: AnyRef): AnyRef = instance(that) - - private val instance = bottomUp(Rewriter.lift { - case query@SingleQuery(clauses) => - val newClauses = clauses.flatMap { - case clause@CreateNewSourceGraph(snapshot, graph, of, at) => - val createGraph = CreateRegularGraph(snapshot, graph, of, at)(clause.position) - val p = clause.position - val newWith = With( - ReturnItems(includeExisting = true, Seq.empty)(p), - GraphReturnItems(includeExisting = true, Seq(NewContextGraphs(GraphAs(graph, None)(p))(p)))(p) - )(p) - Seq(createGraph, newWith) - - case clause@CreateNewTargetGraph(snapshot, graph, of, at) => - val createGraph = CreateRegularGraph(snapshot, graph, of, at)(clause.position) - val p = clause.position - val newWith = With( - ReturnItems(includeExisting = true, Seq.empty)(p), - GraphReturnItems(includeExisting = true, Seq(NewTargetGraph(GraphAs(graph, None)(p))(p)))(p) - )(p) - Seq(createGraph, newWith) - - case clause => - Some(clause) - } - query.copy(clauses = newClauses)(query.position) - }) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/desugarMapProjection.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/desugarMapProjection.scala deleted file mode 100644 index 8406d16640035..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/desugarMapProjection.scala +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{InputPosition, InternalException, Rewriter, topDown} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticState -import org.neo4j.cypher.internal.v3_5.expressions._ - -/* -Handles rewriting map projection elements to literal entries when possible. If the user -has used an all properties selector ( n{ .* } ), we need to do the work in runtime. -In these situations, the rewriter turns as much as possible into literal entries, -so the runtime only has two cases to handle - literal entries and the special all-props selector. - -We can't rewrite all the way to literal maps, since map projections yield a null map when the map_variable is null, -and the same behaviour can't be mimicked with literal maps. - */ -case class desugarMapProjection(state: SemanticState) extends Rewriter { - def apply(that: AnyRef): AnyRef = topDown(instance).apply(that) - - private val instance: Rewriter = Rewriter.lift { - case e@MapProjection(id, items, definitionPos) => - - def propertySelect(propertyPosition: InputPosition, name: String): LiteralEntry = { - val key = PropertyKeyName(name)(propertyPosition) - val idPos = definitionPos.getOrElse(throw new InternalException("MapProjection definition pos is not known")) - val newIdentifier = Variable(id.name)(idPos) - val value = Property(newIdentifier, key)(propertyPosition) - LiteralEntry(key, value)(propertyPosition) - } - - def identifierSelect(id: Variable): LiteralEntry = - LiteralEntry(PropertyKeyName(id.name)(id.position), id)(id.position) - - var includeAllProps = false - - val mapExpressionItems = items.flatMap { - case x: LiteralEntry => Some(x) - case x: AllPropertiesSelector => includeAllProps = true; None - case PropertySelector(property: Variable) => Some(propertySelect(property.position, property.name)) - case VariableSelector(identifier: Variable) => Some(identifierSelect(identifier)) - } - - DesugaredMapProjection(id, mapExpressionItems, includeAllProps)(e.position) - } -} - -case class DesugaredMapProjection( - name: LogicalVariable, - items: Seq[LiteralEntry], - includeAllProps: Boolean - )(val position: InputPosition) extends Expression diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/expandCallWhere.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/expandCallWhere.scala deleted file mode 100644 index f3797f3d7274f..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/expandCallWhere.scala +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.frontend.v3_5.ast._ - -// Rewrites CALL proc WHERE

==> CALL proc WITH * WHERE

-case object expandCallWhere extends Rewriter { - - private val instance = bottomUp(Rewriter.lift { - case query@SingleQuery(clauses) => - val newClauses = clauses.flatMap { - case unresolved@UnresolvedCall(_, _, _, Some(result@ProcedureResult(_, optWhere@Some(where)))) => - val newResult = result.copy(where = None)(result.position) - val newUnresolved = unresolved.copy(declaredResult = Some(newResult))(unresolved.position) - val newItems = ReturnItems(includeExisting = true, Seq.empty)(where.position) - val newWith = With(distinct = false, newItems, PassAllGraphReturnItems(where.position), None, None, None, optWhere)(where.position) - Seq(newUnresolved, newWith) - - case clause => - Some(clause) - } - query.copy(clauses = newClauses)(query.position) - }) - - override def apply(v: AnyRef): AnyRef = - instance(v) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/expandStar.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/expandStar.scala deleted file mode 100644 index d2d0e38312b4b..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/expandStar.scala +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticFeature, SemanticState} -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, Variable} - -case class expandStar(state: SemanticState) extends Rewriter { - - def apply(that: AnyRef): AnyRef = instance(that) - - private val rewriter = Rewriter.lift { - case clause@With(_, values, graphs, _, _, _, _) - if values.includeExisting || graphs.includeExisting => - val newReturnItems = if (values.includeExisting) returnItems(clause, values.items) else values - val newGraphItems = graphs match { - case GraphReturnItems(true, graphItems) if state.features(SemanticFeature.MultipleGraphs) => graphReturnItems(clause, graphItems) - case _ => graphs - } - clause.copy(returnItems = newReturnItems, mandatoryGraphReturnItems = newGraphItems)(clause.position) - - case clause: PragmaWithout => - val items = if (state.features(SemanticFeature.MultipleGraphs)) - graphReturnItems(clause, List.empty, clause.excludedNames) - else GraphReturnItems(includeExisting = true, Seq.empty)(clause.position) - With( - distinct = false, - returnItems = returnItems(clause, Seq.empty, clause.excludedNames), - mandatoryGraphReturnItems = items, - orderBy = None, skip = None, limit = None, where = None)(clause.position) - - case clause@Return(_, values, graphs, _, _, _, excludedNames) - if values.includeExisting || graphs.exists(_.includeExisting) => - val newReturnItems = if (values.includeExisting) returnItems(clause, values.items, excludedNames) else values - val newGraphItems = graphs match { - case Some(GraphReturnItems(true, graphItems)) if state.features(SemanticFeature.MultipleGraphs) => - val newItems = graphReturnItems(clause, graphItems, excludedNames) - if (newItems.graphs.isEmpty) None else Some(newItems) - case _ => - graphs - } - - clause.copy(returnItems = newReturnItems, graphReturnItems = newGraphItems, excludedNames = Set.empty)(clause.position) - - case expandedAstNode => - expandedAstNode - } - - private val instance = bottomUp(rewriter, _.isInstanceOf[Expression]) - - private def graphReturnItems(clause: Clause, listedItems: Seq[GraphReturnItem], excludedNames: Set[String] = Set.empty) - : GraphReturnItems = { - val scope = state.scope(clause).getOrElse { - throw new IllegalStateException(s"${clause.name} should note its Scope in the SemanticState") - } - val clausePos = clause.position - val symbolNames = scope.selectSymbolNames(_.graph) -- excludedNames - val filteredListedItems = listedItems.flatMap(_.filter(!_.isUnboundContextGraph)) - val newGraphItems = symbolNames.toIndexedSeq.sorted.map { id => - val symbol = scope.symbolTable(id) - val idPos = symbol.definition.position - val expr = Variable(id)(idPos) - val alias = expr.copyId - ReturnedGraph( - GraphAs( - expr, - Some(alias), - symbol.generated - )(clausePos) - )(clausePos) - }.toList ++ filteredListedItems - GraphReturnItems(includeExisting = false, newGraphItems)(clausePos) - } - - private def returnItems(clause: Clause, listedItems: Seq[ReturnItem], excludedNames: Set[String] = Set.empty) - : ReturnItemsDef = { - val scope = state.scope(clause).getOrElse { - throw new IllegalStateException(s"${clause.name} should note its Scope in the SemanticState") - } - - val clausePos = clause.position - val symbolNames = scope.selectSymbolNames(! _.graph) -- excludedNames - val expandedItems = symbolNames.toIndexedSeq.sorted.map { id => - val idPos = scope.symbolTable(id).definition.position - val expr = Variable(id)(idPos) - val alias = expr.copyId - AliasedReturnItem(expr, alias)(clausePos) - } - - val newItems = expandedItems ++ listedItems - ReturnItems(includeExisting = false, newItems)(clausePos) - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/foldConstants.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/foldConstants.scala deleted file mode 100644 index 69aa65cff25ed..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/foldConstants.scala +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.v3_5.expressions._ - -case object foldConstants extends Rewriter { - def apply(that: AnyRef): AnyRef = - try { - instance.apply(that) - } catch { - case e: java.lang.ArithmeticException => throw new util.v3_5.ArithmeticException(e.getMessage, e) - } - private val instance: Rewriter = bottomUp(Rewriter.lift { - case e@Add(lhs: SignedIntegerLiteral, rhs: SignedIntegerLiteral) => - SignedDecimalIntegerLiteral((lhs.value + rhs.value).toString)(e.position) - case e@Add(lhs: DecimalDoubleLiteral, rhs: SignedIntegerLiteral) => - DecimalDoubleLiteral((lhs.value + rhs.value).toString)(e.position) - case e@Add(lhs: SignedIntegerLiteral, rhs: DecimalDoubleLiteral) => - DecimalDoubleLiteral((lhs.value + rhs.value).toString)(e.position) - case e@Add(lhs: DecimalDoubleLiteral, rhs: DecimalDoubleLiteral) => - DecimalDoubleLiteral((lhs.value + rhs.value).toString)(e.position) - - case e@Subtract(lhs: SignedIntegerLiteral, rhs: SignedIntegerLiteral) => - SignedDecimalIntegerLiteral((lhs.value - rhs.value).toString)(e.position) - case e@Subtract(lhs: DecimalDoubleLiteral, rhs: SignedIntegerLiteral) => - DecimalDoubleLiteral((lhs.value - rhs.value).toString)(e.position) - case e@Subtract(lhs: SignedIntegerLiteral, rhs: DecimalDoubleLiteral) => - DecimalDoubleLiteral((lhs.value - rhs.value).toString)(e.position) - case e@Subtract(lhs: DecimalDoubleLiteral, rhs: DecimalDoubleLiteral) => - DecimalDoubleLiteral((lhs.value - rhs.value).toString)(e.position) - - case e@Multiply(lhs: SignedIntegerLiteral, rhs: SignedIntegerLiteral) => - SignedDecimalIntegerLiteral((lhs.value * rhs.value).toString)(e.position) - case e@Multiply(lhs: DecimalDoubleLiteral, rhs: SignedIntegerLiteral) => - DecimalDoubleLiteral((lhs.value * rhs.value).toString)(e.position) - case e@Multiply(lhs: SignedIntegerLiteral, rhs: DecimalDoubleLiteral) => - DecimalDoubleLiteral((lhs.value * rhs.value).toString)(e.position) - case e@Multiply(lhs: DecimalDoubleLiteral, rhs: DecimalDoubleLiteral) => - DecimalDoubleLiteral((lhs.value * rhs.value).toString)(e.position) - - case e@Multiply(lhs: NumberLiteral, rhs: NumberLiteral) => - e - case e@Multiply(lhs: NumberLiteral, rhs) => - Multiply(rhs, lhs)(e.position).rewrite(instance) - case e@Multiply(lhs@Multiply(innerLhs, innerRhs: NumberLiteral), rhs: NumberLiteral) => - Multiply(Multiply(innerRhs, rhs)(lhs.position), innerLhs)(e.position).rewrite(instance) - case e@Multiply(lhs@Multiply(innerLhs: NumberLiteral, innerRhs), rhs: NumberLiteral) => - Multiply(Multiply(innerLhs, rhs)(lhs.position), innerRhs)(e.position).rewrite(instance) - - case e@Divide(lhs: SignedIntegerLiteral, rhs: SignedIntegerLiteral) => - SignedDecimalIntegerLiteral((lhs.value / rhs.value).toString)(e.position) - case e@Divide(lhs: DecimalDoubleLiteral, rhs: SignedIntegerLiteral) => - DecimalDoubleLiteral((lhs.value / rhs.value).toString)(e.position) - case e@Divide(lhs: SignedIntegerLiteral, rhs: DecimalDoubleLiteral) => - DecimalDoubleLiteral((lhs.value / rhs.value).toString)(e.position) - case e@Divide(lhs: DecimalDoubleLiteral, rhs: DecimalDoubleLiteral) => - DecimalDoubleLiteral((lhs.value / rhs.value).toString)(e.position) - - case e@Modulo(lhs: SignedIntegerLiteral, rhs: SignedIntegerLiteral) => - SignedDecimalIntegerLiteral((lhs.value % rhs.value).toString)(e.position) - case e@Modulo(lhs: DecimalDoubleLiteral, rhs: SignedIntegerLiteral) => - DecimalDoubleLiteral((lhs.value % rhs.value).toString)(e.position) - case e@Modulo(lhs: SignedIntegerLiteral, rhs: DecimalDoubleLiteral) => - DecimalDoubleLiteral((lhs.value % rhs.value).toString)(e.position) - case e@Modulo(lhs: DecimalDoubleLiteral, rhs: DecimalDoubleLiteral) => - DecimalDoubleLiteral((lhs.value % rhs.value).toString)(e.position) - - case e@Pow(lhs: SignedIntegerLiteral, rhs: SignedIntegerLiteral) => - DecimalDoubleLiteral(Math.pow(lhs.value.toDouble, rhs.value.toDouble).toString)(e.position) - case e@Pow(lhs: DecimalDoubleLiteral, rhs: SignedIntegerLiteral) => - DecimalDoubleLiteral(Math.pow(lhs.value, rhs.value.toDouble).toString)(e.position) - case e@Pow(lhs: SignedIntegerLiteral, rhs: DecimalDoubleLiteral) => - DecimalDoubleLiteral(Math.pow(lhs.value.toDouble, rhs.value).toString)(e.position) - case e@Pow(lhs: DecimalDoubleLiteral, rhs: DecimalDoubleLiteral) => - DecimalDoubleLiteral(Math.pow(lhs.value, rhs.value).toString)(e.position) - - case e: UnaryAdd => - e.rhs - - case e@UnarySubtract(rhs: SignedIntegerLiteral) => - SignedDecimalIntegerLiteral((-rhs.value).toString)(e.position) - case e: UnarySubtract => - Subtract(SignedDecimalIntegerLiteral("0")(e.position), e.rhs)(e.position) - - case e@Equals(lhs: IntegerLiteral, rhs: IntegerLiteral) => asAst(lhs.value == rhs.value, e) - case e@Equals(lhs: DoubleLiteral, rhs: DoubleLiteral) => asAst(lhs.value == rhs.value, e) - case e@Equals(lhs: IntegerLiteral, rhs: DoubleLiteral) => asAst(lhs.value.doubleValue() == rhs.value, e) - case e@Equals(lhs: DoubleLiteral, rhs: IntegerLiteral) => asAst(lhs.value == rhs.value.doubleValue(), e) - - case e@LessThan(lhs: IntegerLiteral, rhs: IntegerLiteral) => asAst(lhs.value < rhs.value, e) - case e@LessThan(lhs: DoubleLiteral, rhs: DoubleLiteral) => asAst(lhs.value < rhs.value, e) - case e@LessThan(lhs: IntegerLiteral, rhs: DoubleLiteral) => asAst(lhs.value.doubleValue() < rhs.value, e) - case e@LessThan(lhs: DoubleLiteral, rhs: IntegerLiteral) => asAst(lhs.value < rhs.value.doubleValue(), e) - - case e@GreaterThan(lhs: IntegerLiteral, rhs: IntegerLiteral) => asAst(lhs.value > rhs.value, e) - case e@GreaterThan(lhs: DoubleLiteral, rhs: DoubleLiteral) => asAst(lhs.value > rhs.value, e) - case e@GreaterThan(lhs: IntegerLiteral, rhs: DoubleLiteral) => asAst(lhs.value.doubleValue() > rhs.value, e) - case e@GreaterThan(lhs: DoubleLiteral, rhs: IntegerLiteral) => asAst(lhs.value > rhs.value.doubleValue(), e) - }) - - private def asAst(b: Boolean, e: Expression) = if (b) True()(e.position) else False()(e.position) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/inlineNamedPathsInPatternComprehensions.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/inlineNamedPathsInPatternComprehensions.scala deleted file mode 100644 index 0bd35d3fa47c3..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/inlineNamedPathsInPatternComprehensions.scala +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.v3_5.expressions._ - -case object inlineNamedPathsInPatternComprehensions extends Rewriter { - - private val instance = bottomUp(Rewriter.lift { - case expr @ PatternComprehension(Some(path), pattern, predicate, projection, _) => - val patternElement = pattern.element - expr.copy( - namedPath = None, - predicate = predicate.map(_.inline(path, patternElement)), - projection = projection.inline(path, patternElement) - )(expr.position) - }) - - private implicit final class InliningExpression(val expr: Expression) extends AnyVal { - def inline(path: LogicalVariable, patternElement: PatternElement) = - expr.copyAndReplace(path) by { - PathExpression(projectNamedPaths.patternPartPathExpression(patternElement))(expr.position) - } - } - - override def apply(v: AnyRef): AnyRef = instance(v) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/isolateAggregation.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/isolateAggregation.scala deleted file mode 100644 index 898ba2ac5729f..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/isolateAggregation.scala +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{AggregationNameGenerator, InternalException, Rewriter, bottomUp} -import org.neo4j.cypher.internal.v3_5.expressions._ -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.helpers.fixedPoint - -/** - * This rewriter makes sure that aggregations are on their own in RETURN/WITH clauses, so - * the planner can have an easy time - * - * Example: - * - * MATCH (n) - * RETURN { name: n.name, count: count(*) }, n.foo - * - * This query has a RETURN clause where the single expression contains both the aggregate key and - * the aggregation expression. To make the job easier on the planner, this rewrite will change the query to: - * - * MATCH (n) - * WITH n.name AS x1, count(*) AS x2, n.foo as X3 - * RETURN { name: x1, count: x2 } - */ -case object isolateAggregation extends Rewriter { - def apply(that: AnyRef): AnyRef = instance(that) - - private val rewriter = Rewriter.lift { - case q@SingleQuery(clauses) => - - val newClauses = clauses.flatMap { - case clause if !clauseNeedingWork(clause) => IndexedSeq(clause) - case clause => - val (withAggregations, others) = getExpressions(clause).partition(hasAggregateButIsNotAggregate(_)) - - val expressionsToIncludeInWith: Set[Expression] = others ++ extractExpressionsToInclude(withAggregations) - - val withReturnItems: Set[ReturnItem] = expressionsToIncludeInWith.map { - case e => AliasedReturnItem(e, Variable(AggregationNameGenerator.name(e.position))(e.position))(e.position) - } - val pos = clause.position - val withClause = With(distinct = false, ReturnItems(includeExisting = false, withReturnItems.toIndexedSeq)(pos), PassAllGraphReturnItems(pos), None, None, None, None)(pos) - - val expressionRewriter = createRewriterFor(withReturnItems) - val resultClause = clause.endoRewrite(expressionRewriter) - - IndexedSeq(withClause, resultClause) - } - - q.copy(clauses = newClauses)(q.position) - } - - private def createRewriterFor(withReturnItems: Set[ReturnItem]): Rewriter = { - def inner = Rewriter.lift { - case original: Expression => - val rewrittenExpression = withReturnItems.collectFirst { - case item@AliasedReturnItem(expression, variable) if original == expression => - item.alias.get.copyId - } - rewrittenExpression getOrElse original - } - - ReturnItemSafeTopDownRewriter(inner) - } - - private def extractExpressionsToInclude(originalExpressions: Set[Expression]): Set[Expression] = { - val expressionsToGoToWith: Set[Expression] = fixedPoint { - (expressions: Set[Expression]) => expressions.flatMap { - case e@ReduceExpression(_, init, coll) if hasAggregateButIsNotAggregate(e) => - Seq(init, coll) - - case e@FilterExpression(_, expr) if hasAggregateButIsNotAggregate(e) => - Seq(expr) - - case e@ExtractExpression(_, expr) if hasAggregateButIsNotAggregate(e) => - Seq(expr) - - case e@ListComprehension(_, expr) if hasAggregateButIsNotAggregate(e) => - Seq(expr) - - case e@DesugaredMapProjection(variable, items, _) if hasAggregateButIsNotAggregate(e) => - items.map(_.exp) :+ variable - - case e: IterablePredicateExpression if hasAggregateButIsNotAggregate(e) => - val predicate: Expression = e.innerPredicate.getOrElse(throw new InternalException("Should never be empty")) - // Weird way of doing it to make scalac happy - Set(e.expression) ++ predicate.dependencies - e.variable - - case e if hasAggregateButIsNotAggregate(e) => - e.arguments - - case e => - Seq(e) - } - }(originalExpressions).filter { - //Constant expressions should never be isolated - expr => IsAggregate(expr) || expr.dependencies.nonEmpty - } - expressionsToGoToWith - } - - private val instance = bottomUp(rewriter, _.isInstanceOf[Expression]) - - private def getExpressions(c: Clause): Set[Expression] = c match { - case clause: Return => clause.returnItems.items.map(_.expression).toSet - case clause: With => clause.returnItems.items.map(_.expression).toSet - case _ => Set.empty - } - - private def clauseNeedingWork(c: Clause): Boolean = c.treeExists { - case e: Expression => hasAggregateButIsNotAggregate(e) - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/literalReplacement.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/literalReplacement.scala deleted file mode 100644 index 8dbbb9e85e6d7..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/literalReplacement.scala +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.frontend.v3_5.IdentityMap -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.util.v3_5.symbols.{CTAny, CTFloat, CTInteger, CTList, CTString} -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, Rewriter, bottomUp} -import org.neo4j.cypher.internal.v3_5.expressions._ - -object literalReplacement { - - case class LiteralReplacement(parameter: Parameter, value: AnyRef) - type LiteralReplacements = IdentityMap[Expression, LiteralReplacement] - - case class ExtractParameterRewriter(replaceableLiterals: LiteralReplacements) extends Rewriter { - def apply(that: AnyRef): AnyRef = rewriter.apply(that) - - private val rewriter: Rewriter = bottomUp(Rewriter.lift { - case l: Expression if replaceableLiterals.contains(l) => replaceableLiterals(l).parameter - }) - } - - private val literalMatcher: PartialFunction[Any, LiteralReplacements => (LiteralReplacements, Option[LiteralReplacements => LiteralReplacements])] = { - case _: Match | - _: Create | - _: CreateUnique | - _: Merge | - _: SetClause | - _: Return | - _: With | - _: Unwind | - _: CallClause => - acc => (acc, Some(identity)) - case _: Clause | - _: PeriodicCommitHint | - _: Limit => - acc => (acc, None) - case n: NodePattern => - acc => (n.properties.treeFold(acc)(literalMatcher), None) - case r: RelationshipPattern => - acc => (r.properties.treeFold(acc)(literalMatcher), None) - case ContainerIndex(_, _: StringLiteral) => - acc => (acc, None) - case _: GraphUrl => - acc => (acc, None) - case l: StringLiteral => - acc => - if (acc.contains(l)) (acc, None) else { - val parameter = Parameter(s" AUTOSTRING${acc.size}", CTString)(l.position) - (acc + (l -> LiteralReplacement(parameter, l.value)), None) - } - case l: IntegerLiteral => - acc => - if (acc.contains(l)) (acc, None) else { - val parameter = Parameter(s" AUTOINT${acc.size}", CTInteger)(l.position) - (acc + (l -> LiteralReplacement(parameter, l.value)), None) - } - case l: DoubleLiteral => - acc => - if (acc.contains(l)) (acc, None) else { - val parameter = Parameter(s" AUTODOUBLE${acc.size}", CTFloat)(l.position) - (acc + (l -> LiteralReplacement(parameter, l.value)), None) - } - case l: ListLiteral if l.expressions.forall(_.isInstanceOf[Literal]) => - acc => - if (acc.contains(l)) (acc, None) else { - val parameter = Parameter(s" AUTOLIST${acc.size}", CTList(CTAny))(l.position) - val values: Seq[AnyRef] = l.expressions.map(_.asInstanceOf[Literal].value).toIndexedSeq - (acc + (l -> LiteralReplacement(parameter, values)), None) - } - } - - private def doIt(term: ASTNode) = { - val replaceableLiterals = term.treeFold(IdentityMap.empty: LiteralReplacements)(literalMatcher) - - val extractedParams: Map[String, AnyRef] = replaceableLiterals.map { - case (_, LiteralReplacement(parameter, value)) => (parameter.name, value) - } - - (ExtractParameterRewriter(replaceableLiterals), extractedParams) - } - - def apply(term: ASTNode, paramExtraction: LiteralExtraction): (Rewriter, Map[String, Any]) = paramExtraction match { - case Never => - Rewriter.noop -> Map.empty - case Forced => - doIt(term) - case IfNoParameter => - val containsParameter: Boolean = term.treeExists { - case _: Parameter => true - } - - if (containsParameter) Rewriter.noop -> Map.empty - else doIt(term) - } -} - -sealed trait LiteralExtraction -case object Forced extends LiteralExtraction -case object IfNoParameter extends LiteralExtraction -case object Never extends LiteralExtraction diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/mergeInPredicates.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/mergeInPredicates.scala deleted file mode 100644 index 6983fe384eca4..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/mergeInPredicates.scala +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.frontend.v3_5.ast.Where -import org.neo4j.cypher.internal.util.v3_5.Foldable._ -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.v3_5.expressions._ - -/** - * Merges multiple IN predicates into one. - * - * Examples: - * MATCH (n) WHERE n.prop IN [1,2,3] AND [2,3,4] RETURN n.prop - * => MATCH (n) WHERE n.prop IN [2,3] - * - * MATCH (n) WHERE n.prop IN [1,2,3] OR [2,3,4] RETURN n.prop - * => MATCH (n) WHERE n.prop IN [1,2,3,4] - * - * MATCH (n) WHERE n.prop IN [1,2,3] AND [4,5,6] RETURN n.prop - * => MATCH (n) WHERE FALSE - * - * NOTE: this rewriter must be applied before auto parameterization, since after - * that we are just dealing with opaque parameters. - */ -case object mergeInPredicates extends Rewriter { - - def apply(that: AnyRef): AnyRef = inner.apply(that) - - private val inner: Rewriter = bottomUp(Rewriter.lift { - //Look for a `IN [...] AND a IN [...]` and compute the intersection of lists - case and@And(lhs, rhs) => - rewriteBinaryOperator(and, (a, b) => a intersect b, (l, r) => and.copy(l, r)(and.position)) - //Look for `a IN [...] OR a IN [...]` and compute union of lists - case or@Or(lhs, rhs) => - rewriteBinaryOperator(or, (a, b) => a union b, - (l, r) => or.copy(l, r)(or.position)) - }) - - //Takes a binary operator a merge operator and a copy constructor - //and rewrites the binary operator - private def rewriteBinaryOperator(binary: BinaryOperatorExpression, - merge: (Seq[Expression], Seq[Expression]) => Seq[Expression], - copy: (Expression, Expression) => Expression): Expression = { - val rewriter = inRewriter(collectInPredicates(merge)(binary.lhs, binary.rhs)) - val newLhs = binary.lhs.endoRewrite(rewriter) - val newRhs = binary.rhs.endoRewrite(rewriter) - if (newLhs == newRhs) newLhs - else copy(newLhs, newRhs) - } - - //Rewrites a IN [] by using the the provided map of precomputed lists - //a IN ... is rewritten to a IN inPredicates(a) - private def inRewriter(inPredicates: Map[Expression, Seq[Expression]]) = bottomUp(Rewriter.lift({ - case in@In(a, list@ListLiteral(_)) => - val expressions = inPredicates(a) - if (expressions.nonEmpty) in.copy(rhs = list.copy(expressions)(list.position))(in.position) - else False()(in.position) - })) - - //Given `a IN A ... b IN B ... a IN C` and use `merge` to merge all the lists with the same key. - //Returns {a -> merge(A,B), b -> C} - private def collectInPredicates(merge: (Seq[Expression], Seq[Expression]) => Seq[Expression]) - (expressions: Expression*): Map[Expression, Seq[Expression]] = { - val maps = expressions.map(_.treeFold(Map.empty[Expression, Seq[Expression]]) { - case In(a, ListLiteral(exprs)) => (map) => { - //if there is already a list associated with `a`, do map(a) ++ exprs otherwise exprs - val values = map.get(a).map(current => merge(current, exprs)).getOrElse(exprs).distinct - (map + (a -> values), None) - } - }) - //Take list of maps, [map1,map2,...] and merge the using the provided `merge` to - //merge lists - maps.reduceLeft((acc, current) => { - val sharedKeys = acc.keySet intersect current.keySet - val updates = sharedKeys.map(k => k -> merge(acc(k), current(k)).distinct) - acc ++ updates ++ (current -- sharedKeys) - }) - } -} \ No newline at end of file diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/nameAllPatternElements.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/nameAllPatternElements.scala deleted file mode 100644 index 93340cdb3bec3..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/nameAllPatternElements.scala +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, UnNamedNameGenerator, bottomUp} -import org.neo4j.cypher.internal.v3_5.expressions.{NodePattern, RelationshipPattern, Variable} - -case object nameAllPatternElements extends Rewriter { - - override def apply(in: AnyRef): AnyRef = namingRewriter.apply(in) - - val namingRewriter: Rewriter = bottomUp(Rewriter.lift { - case pattern: NodePattern if pattern.variable.isEmpty => - val syntheticName = UnNamedNameGenerator.name(pattern.position.bumped()) - pattern.copy(variable = Some(Variable(syntheticName)(pattern.position)))(pattern.position) - - case pattern: RelationshipPattern if pattern.variable.isEmpty => - val syntheticName = UnNamedNameGenerator.name(pattern.position.bumped()) - pattern.copy(variable = Some(Variable(syntheticName)(pattern.position)))(pattern.position) - }) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/nameGraphOfPatternElements.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/nameGraphOfPatternElements.scala deleted file mode 100644 index 257912e0c707a..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/nameGraphOfPatternElements.scala +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.frontend.v3_5.ast.GraphOfAs -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.v3_5.expressions.Expression - -case object nameGraphOfPatternElements extends Rewriter { - - def apply(that: AnyRef): AnyRef = instance(that) - - private val rewriter = Rewriter.lift { - case g: GraphOfAs => - val rewrittenPattern = g.of.endoRewrite(nameAllPatternElements.namingRewriter) - g.copy(of = rewrittenPattern)(g.position) - } - - private val instance = bottomUp(rewriter, _.isInstanceOf[Expression]) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/nameMatchPatternElements.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/nameMatchPatternElements.scala deleted file mode 100644 index 1543176b62102..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/nameMatchPatternElements.scala +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.frontend.v3_5.ast.Match -import org.neo4j.cypher.internal.v3_5.expressions.Expression - -case object nameMatchPatternElements extends Rewriter { - - def apply(that: AnyRef): AnyRef = instance(that) - - private val rewriter = Rewriter.lift { - case m: Match => - val rewrittenPattern = m.pattern.endoRewrite(nameAllPatternElements.namingRewriter) - m.copy(pattern = rewrittenPattern)(m.position) - } - - private val instance = bottomUp(rewriter, _.isInstanceOf[Expression]) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/namePatternComprehensionPatternElements.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/namePatternComprehensionPatternElements.scala deleted file mode 100644 index 6d590cf1947ee..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/namePatternComprehensionPatternElements.scala +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.v3_5.expressions.PatternComprehension - -case object namePatternComprehensionPatternElements extends Rewriter { - - private val instance = bottomUp(Rewriter.lift { - case expr: PatternComprehension => - val (namedComprehension, _) = PatternExpressionPatternElementNamer(expr) - namedComprehension - }) - - override def apply(v: AnyRef): AnyRef = instance(v) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/nameUpdatingClauses.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/nameUpdatingClauses.scala deleted file mode 100644 index 955127a7ee3b2..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/nameUpdatingClauses.scala +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.frontend.v3_5.ast.{Create, CreateUnique, Merge} -import org.neo4j.cypher.internal.v3_5.expressions.Expression - -case object nameUpdatingClauses extends Rewriter { - - def apply(that: AnyRef): AnyRef = instance(that) - - private val findingRewriter: Rewriter = Rewriter.lift { - case createUnique@CreateUnique(pattern) => - val rewrittenPattern = pattern.endoRewrite(nameAllPatternElements.namingRewriter) - createUnique.copy(pattern = rewrittenPattern)(createUnique.position) - - case create@Create(pattern) => - val rewrittenPattern = pattern.endoRewrite(nameAllPatternElements.namingRewriter) - create.copy(pattern = rewrittenPattern)(create.position) - - case merge@Merge(pattern, _, _) => - val rewrittenPattern = pattern.endoRewrite(nameAllPatternElements.namingRewriter) - merge.copy(pattern = rewrittenPattern)(merge.position) - } - - private val instance = bottomUp(findingRewriter, _.isInstanceOf[Expression]) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeArgumentOrder.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeArgumentOrder.scala deleted file mode 100644 index 4fb32746d1abf..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeArgumentOrder.scala +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, topDown} -import org.neo4j.cypher.internal.v3_5.functions -import org.neo4j.cypher.internal.v3_5.expressions.{Equals, FunctionInvocation, InequalityExpression, Property} - -// TODO: Support n.prop m.prop, perhaps by -// either killing this and just looking on both lhs and rhs all over the place or -// by duplicating the predicate and somehow ignoring it during cardinality calculation -// -case object normalizeArgumentOrder extends Rewriter { - - override def apply(that: AnyRef): AnyRef = instance(that) - - private val instance: Rewriter = topDown(Rewriter.lift { - - // move id(n) on equals to the left - case predicate @ Equals(func@FunctionInvocation(_, _, _, _), _) if func.function == functions.Id => - predicate - - case predicate @ Equals(lhs, rhs @ FunctionInvocation(_, _, _, _)) if rhs.function == functions.Id => - predicate.copy(lhs = rhs, rhs = lhs)(predicate.position) - - // move n.prop on equals to the left - case predicate @ Equals(Property(_, _), _) => - predicate - - case predicate @ Equals(lhs, rhs @ Property(_, _)) => - predicate.copy(lhs = rhs, rhs = lhs)(predicate.position) - - case inequality: InequalityExpression => - val lhsIsProperty = inequality.lhs.isInstanceOf[Property] - val rhsIsProperty = inequality.rhs.isInstanceOf[Property] - if (!lhsIsProperty && rhsIsProperty) { - inequality.swapped - } else { - inequality - } - }) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeComparisons.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeComparisons.scala deleted file mode 100644 index baaa790c7fb69..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeComparisons.scala +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, topDown} -import org.neo4j.cypher.internal.v3_5.expressions._ - -case object normalizeComparisons extends Rewriter { - - override def apply(that: AnyRef): AnyRef = instance(that) - - private val instance: Rewriter = topDown(Rewriter.lift { - case c@NotEquals(lhs, rhs) => - NotEquals(lhs.endoRewrite(copyVariables), rhs.endoRewrite(copyVariables))(c.position) - case c@Equals(lhs, rhs) => - Equals(lhs.endoRewrite(copyVariables), rhs.endoRewrite(copyVariables))(c.position) - case c@LessThan(lhs, rhs) => - LessThan(lhs.endoRewrite(copyVariables), rhs.endoRewrite(copyVariables))(c.position) - case c@LessThanOrEqual(lhs, rhs) => - LessThanOrEqual(lhs.endoRewrite(copyVariables), rhs.endoRewrite(copyVariables))(c.position) - case c@GreaterThan(lhs, rhs) => - GreaterThan(lhs.endoRewrite(copyVariables), rhs.endoRewrite(copyVariables))(c.position) - case c@GreaterThanOrEqual(lhs, rhs) => - GreaterThanOrEqual(lhs.endoRewrite(copyVariables), rhs.endoRewrite(copyVariables))(c.position) - case c@InvalidNotEquals(lhs, rhs) => - InvalidNotEquals(lhs.endoRewrite(copyVariables), rhs.endoRewrite(copyVariables))(c.position) - case c@HasLabels(expr, labels) if labels.size > 1 => - val hasLabels = labels.map(l => HasLabels(expr.endoRewrite(copyVariables), Seq(l))(c.position)) - Ands(hasLabels.toSet)(c.position) - }) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeGraphReturnItems.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeGraphReturnItems.scala deleted file mode 100644 index f2ea9b5be1cdc..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeGraphReturnItems.scala +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{FreshIdNameGenerator, Rewriter, bottomUp} -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, Variable} - -case object normalizeGraphReturnItems extends Rewriter { - - def apply(that: AnyRef): AnyRef = instance(that) - - private val rewriter = Rewriter.lift { - case item: SourceGraphAs => item - case item: TargetGraphAs => item - case graphItem@GraphAs(ref, None, _) => - graphItem.copy(as = Some(Variable(ref.name)(ref.position)))(graphItem.position) - case graphItem: SingleGraphAs if graphItem.as.isEmpty => - val pos = graphItem.position.bumped() - graphItem.withNewName(Variable(FreshIdNameGenerator.name(pos))(pos)).asGenerated - } - - private val instance = bottomUp(rewriter, _.isInstanceOf[Expression]) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeMatchPredicates.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeMatchPredicates.scala deleted file mode 100644 index 2855b5a11e00d..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeMatchPredicates.scala +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -case class normalizeMatchPredicates(getDegreeRewriting: Boolean) - extends MatchPredicateNormalization(MatchPredicateNormalizerChain(PropertyPredicateNormalizer, LabelPredicateNormalizer), getDegreeRewriting) diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeNotEquals.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeNotEquals.scala deleted file mode 100644 index 685317769e7c2..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeNotEquals.scala +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, topDown} -import org.neo4j.cypher.internal.v3_5.expressions.{Equals, Not, NotEquals} - -case object normalizeNotEquals extends Rewriter { - - override def apply(that: AnyRef): AnyRef = instance(that) - - private val instance: Rewriter = topDown(Rewriter.lift { - case p @ NotEquals(lhs, rhs) => - Not(Equals(lhs, rhs)(p.position))(p.position) // not(1 = 2) 1 != 2 - }) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeReturnClauses.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeReturnClauses.scala deleted file mode 100644 index b66df2225fad8..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeReturnClauses.scala +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, Variable} - -import scala.collection.mutable - -/** - * This rewriter makes sure that all return items in a RETURN clauses are aliased, and moves - * any ORDER BY to a preceding WITH clause - * - * Example: - * - * MATCH (n) - * RETURN n.foo AS foo, n.bar ORDER BY foo - * - * This rewrite will change the query to: - * - * MATCH (n) - * WITH n.foo AS ` FRESHIDxx`, n.bar AS ` FRESHIDnn` ORDER BY ` FRESHIDxx` - * RETURN ` FRESHIDxx` AS foo, ` FRESHIDnn` AS `n.bar` - */ -case class normalizeReturnClauses(mkException: (String, InputPosition) => CypherException) extends Rewriter { - - def apply(that: AnyRef): AnyRef = instance.apply(that) - - private val clauseRewriter: (Clause => Seq[Clause]) = { - case clause @ Return(_, ri@ReturnItems(_, items), _, None, _, _, _) => - val aliasedItems = items.map({ - case i: AliasedReturnItem => - i - case i => - val newPosition = i.expression.position.bumped() - AliasedReturnItem(i.expression, Variable(i.name)(newPosition))(i.position) - }) - Seq( - clause.copy(returnItems = ri.copy(items = aliasedItems)(ri.position))(clause.position) - ) - - case clause @ Return(distinct, ri: ReturnItems, gri, orderBy, skip, limit, _) => - clause.verifyOrderByAggregationUse((s,i) => throw mkException(s,i)) - var rewrites = mutable.Map[Expression, Variable]() - - val (aliasProjection, finalProjection) = ri.items.map { - i => - val returnColumn = i.alias match { - case Some(alias) => alias - case None => Variable(i.name)(i.expression.position.bumped()) - } - - val newVariable = Variable(FreshIdNameGenerator.name(i.expression.position))(i.expression.position) - - // Always update for the return column, so that it has precedence over the expressions (if there are variables with the same name), - // e.g. match (n),(m) return n as m, m as m2 - rewrites += (returnColumn -> newVariable) - // Only update if rewrites does not yet have a mapping for i.expression - rewrites.getOrElseUpdate(i.expression, newVariable) - - (AliasedReturnItem(i.expression, newVariable)(i.position), AliasedReturnItem(newVariable.copyId, returnColumn)(i.position)) - }.unzip - - val newOrderBy = orderBy.endoRewrite(topDown(Rewriter.lift { - case exp: Expression if rewrites.contains(exp) => rewrites(exp).copyId - })) - - val introducedVariables = if (ri.includeExisting) aliasProjection.map(_.variable.name).toSet else Set.empty[String] - - Seq( - With(distinct = distinct, returnItems = ri.copy(items = aliasProjection)(ri.position), gri.getOrElse(PassAllGraphReturnItems(clause.position)), - orderBy = newOrderBy, skip = skip, limit = limit, where = None)(clause.position), - Return(distinct = false, returnItems = ri.copy(items = finalProjection)(ri.position), gri, - orderBy = None, skip = None, limit = None, excludedNames = introducedVariables)(clause.position) - ) - - case clause => - Seq(clause) - } - - private val instance: Rewriter = bottomUp(Rewriter.lift { - case query @ SingleQuery(clauses) => - query.copy(clauses = clauses.flatMap(clauseRewriter))(query.position) - }) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeWithClauses.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeWithClauses.scala deleted file mode 100644 index 35ee7a46dca61..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/normalizeWithClauses.scala +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, LogicalVariable, Variable} - -/** - * This rewriter normalizes the scoping structure of a query, ensuring it is able to - * be correctly processed for semantic checking. It makes sure that all return items - * in a WITH clauses are aliased, and ensures all ORDER BY and WHERE expressions are - * shifted into the clause, leaving only a variable. That variable must also - * appear as an alias in the associated WITH. - * - * This rewriter depends on normalizeReturnClauses having first been run. - * - * Example: - * - * MATCH n - * WITH n.prop AS prop ORDER BY n.foo DESC - * RETURN prop - * - * This rewrite will change the query to: - * - * MATCH n - * WITH n AS n, n.prop AS prop - * WITH prop AS prop, n.foo AS ` FRESHID39` ORDER BY ` FRESHID39` DESC - * WITH prop AS prop - * RETURN prop - * - * It uses multiple WITH clauses to ensure that cardinality and grouping are not altered, even in the presence - * of aggregation. - */ -case class normalizeWithClauses(mkException: (String, InputPosition) => CypherException) extends Rewriter { - - def apply(that: AnyRef): AnyRef = instance.apply(that) - - private val clauseRewriter: (Clause => Seq[Clause]) = { - case clause @ With(_, ri: ReturnItems, _, None, _, _, None) => - val (unaliasedReturnItems, aliasedReturnItems) = partitionReturnItems(ri.items) - val initialReturnItems = unaliasedReturnItems ++ aliasedReturnItems - Seq(clause.copy(returnItems = ri.copy(items = initialReturnItems)(ri.position))(clause.position)) - - case clause @ With(distinct, ri: ReturnItems, gri, orderBy, skip, limit, where) => - clause.verifyOrderByAggregationUse((s,i) => throw mkException(s,i)) - val (unaliasedReturnItems, aliasedReturnItems) = partitionReturnItems(ri.items) - val initialReturnItems = unaliasedReturnItems ++ aliasedReturnItems - val (introducedReturnItems, updatedOrderBy, updatedWhere) = aliasOrderByAndWhere(aliasedReturnItems.map(i => i.expression -> i.alias.get.copyId).toMap, orderBy, where) - val requiredVariablesForOrderBy = updatedOrderBy.map(_.dependencies).getOrElse(Set.empty) diff (introducedReturnItems.map(_.variable).toSet ++ initialReturnItems.flatMap(_.alias)) - - if (orderBy == updatedOrderBy && where == updatedWhere) { - Seq(clause.copy(returnItems = ri.copy(items = initialReturnItems)(ri.position))(clause.position)) - } else if (introducedReturnItems.isEmpty) { - Seq(clause.copy(returnItems = ri.copy(items = initialReturnItems)(ri.position), orderBy = updatedOrderBy, where = updatedWhere)(clause.position)) - } else { - val secondProjection = if (ri.includeExisting) { - introducedReturnItems - } else { - - initialReturnItems.map(item => - item.alias.fold(item)(alias => AliasedReturnItem(alias.copyId, alias.copyId)(item.position)) - ) ++ - requiredVariablesForOrderBy.toIndexedSeq.map(i => AliasedReturnItem(i.copyId, i.copyId)(i.position)) ++ - introducedReturnItems - } - - val firstProjection = if (distinct || ri.containsAggregate || ri.includeExisting) { - initialReturnItems - } else { - val requiredReturnItems = introducedReturnItems.flatMap(_.expression.dependencies).toSet diff initialReturnItems - .flatMap(_.alias).toSet - val requiredVariables = requiredReturnItems ++ requiredVariablesForOrderBy - - requiredVariables.toIndexedSeq.map(i => AliasedReturnItem(i.copyId, i.copyId)(i.position)) ++ initialReturnItems - } - - val introducedVariables = introducedReturnItems.map(_.variable.copyId) - - Seq( - With(distinct = distinct, returnItems = ri.copy(items = firstProjection)(ri.position), mandatoryGraphReturnItems = gri, - orderBy = None, skip = None, limit = None, where = None)(clause.position), - With(distinct = false, returnItems = ri.copy(items = secondProjection)(ri.position), mandatoryGraphReturnItems = gri, - orderBy = updatedOrderBy, skip = skip, limit = limit, where = updatedWhere)(clause.position), - PragmaWithout(introducedVariables)(clause.position) - ) - } - - case clause => - Seq(clause) - } - - private def partitionReturnItems(returnItems: Seq[ReturnItem]): (Seq[ReturnItem], Seq[AliasedReturnItem]) = - returnItems.foldLeft((Vector.empty[ReturnItem], Vector.empty[AliasedReturnItem])) { - case ((unaliasedItems, aliasedItems), item) => item match { - case i: AliasedReturnItem => - (unaliasedItems, aliasedItems :+ i) - - case i if i.alias.isDefined => - (unaliasedItems, aliasedItems :+ AliasedReturnItem(item.expression, item.alias.get.copyId)(item.position)) - - case _ => - // Unaliased return items in WITH will be preserved so that semantic check can report them as an error - (unaliasedItems :+ item, aliasedItems) - } - } - - private def aliasOrderByAndWhere(existingAliases: Map[Expression, LogicalVariable], orderBy: Option[OrderBy], where: Option[Where]): (Seq[AliasedReturnItem], Option[OrderBy], Option[Where]) = { - val (additionalReturnItemsForOrderBy, updatedOrderBy) = orderBy match { - case Some(o) => - val (returnItems, updatedOrderBy) = aliasOrderBy(existingAliases, o) - (returnItems, Some(updatedOrderBy)) - - case None => - (Seq.empty, None) - } - - val (maybeReturnItemForWhere, updatedWhere) = where match { - case Some(w) => - val (maybeReturnItem, updatedWhere) = aliasWhere(existingAliases, w) - (maybeReturnItem, Some(updatedWhere)) - - case None => - (None, None) - } - - (additionalReturnItemsForOrderBy ++ maybeReturnItemForWhere, updatedOrderBy, updatedWhere) - } - - private def aliasOrderBy(existingAliases: Map[Expression, LogicalVariable], originalOrderBy: OrderBy): (Seq[AliasedReturnItem], OrderBy) = { - val (additionalReturnItems, updatedSortItems) = originalOrderBy.sortItems.foldLeft((Vector.empty[AliasedReturnItem], Vector.empty[SortItem])) { - case ((returnItems, sortItems), item) => item.expression match { - case _: Variable => - (returnItems, sortItems :+ item) - - case e: Expression => - val (maybeReturnItem, sortItem) = aliasSortItem(existingAliases, item) - maybeReturnItem match { - case Some(i) if !i.expression.containsAggregate => - (returnItems :+ i, sortItems :+ sortItem) - case Some(i) => - (returnItems, sortItems :+ item) - case None => - (returnItems, sortItems :+ sortItem) - } - } - } - (additionalReturnItems, OrderBy(updatedSortItems)(originalOrderBy.position)) - } - - private def aliasSortItem(existingAliases: Map[Expression, LogicalVariable], sortItem: SortItem): (Option[AliasedReturnItem], SortItem) = { - val expression = sortItem.expression - val (maybeReturnItem, replacementVariable) = aliasExpression(existingAliases, expression) - - val newSortItem = sortItem.endoRewrite(topDown(Rewriter.lift { - case e: Expression if e == expression => - replacementVariable.copyId - })) - (maybeReturnItem, newSortItem) - } - - private def aliasWhere(existingAliases: Map[Expression, LogicalVariable], originalWhere: Where): (Option[AliasedReturnItem], Where) = { - originalWhere.expression match { - case _: Variable => - (None, originalWhere) - - case e: Expression if !e.containsAggregate => - val (maybeReturnItem, replacementVariable) = aliasExpression(existingAliases, e) - (maybeReturnItem, Where(replacementVariable)(originalWhere.position)) - - case e => - (None, originalWhere) - } - } - - private def aliasExpression(existingAliases: Map[Expression, LogicalVariable], expression: Expression): (Option[AliasedReturnItem], LogicalVariable) = { - existingAliases.get(expression) match { - case Some(alias) => - (None, alias.copyId) - - case None => - val newVariable = Variable(FreshIdNameGenerator.name(expression.position))(expression.position) - val newExpression = expression.endoRewrite(topDown(Rewriter.lift { - case e: Expression => - existingAliases.get(e).map(_.copyId).getOrElse(e) - })) - val newReturnItem = AliasedReturnItem(newExpression, newVariable)(expression.position) - (Some(newReturnItem), newVariable.copyId) - } - } - - private val instance: Rewriter = bottomUp(Rewriter.lift { - case query @ SingleQuery(clauses) => - query.copy(clauses = clauses.flatMap(clauseRewriter))(query.position) - }) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/projectFreshSortExpressions.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/projectFreshSortExpressions.scala deleted file mode 100644 index 1a38945750102..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/projectFreshSortExpressions.scala +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.v3_5.expressions.Expression - -/** - * This rewriter ensures that WITH clauses containing a ORDER BY or WHERE are split, such that the ORDER BY or WHERE does not - * refer to any newly introduced variable. - * - * This is required due to constraints in the planner. Note that this structure is invalid for semantic checking, which requires - * that ORDER BY and WHERE _only refer to variables introduced in the associated WITH_. - * - * Additionally, it splits RETURN clauses containing ORDER BY. This would typically be done earlier during normalizeReturnClauses, however - * "RETURN * ORDER BY" is not handled at that stage, due to lacking variable information. If expandStar has already been run, then this - * will now work as expected. - */ -case object projectFreshSortExpressions extends Rewriter { - - override def apply(that: AnyRef): AnyRef = instance(that) - - private val clauseRewriter: (Clause => Seq[Clause]) = { - case clause@With(_, _, _, None, _, _, None) => - Seq(clause) - - case clause@With(_, ri: ReturnItems, _, orderBy, skip, limit, where) => - val allAliases = ri.aliases - val passedThroughAliases = ri.passedThrough - val evaluatedAliases = allAliases -- passedThroughAliases - - if (evaluatedAliases.isEmpty) { - Seq(clause) - } else { - val nonItemDependencies = orderBy.map(_.dependencies).getOrElse(Set.empty) ++ - skip.map(_.dependencies).getOrElse(Set.empty) ++ - limit.map(_.dependencies).getOrElse(Set.empty) ++ - where.map(_.dependencies).getOrElse(Set.empty) - val dependenciesFromPreviousScope = nonItemDependencies -- allAliases - - val passedItems = dependenciesFromPreviousScope.map(AliasedReturnItem(_)) - val outputItems = allAliases.toIndexedSeq.map(AliasedReturnItem(_)) - - val result = Seq( - clause.copy(returnItems = ri.mapItems(originalItems => originalItems ++ passedItems), orderBy = None, skip = None, limit = None, where = None)(clause.position), - clause.copy(distinct = false, returnItems = ri.mapItems(_ => outputItems))(clause.position) - ) - result - } - - case clause => - Seq(clause) - } - - private val rewriter = Rewriter.lift { - case query@SingleQuery(clauses) => - query.copy(clauses = clauses.flatMap(clauseRewriter))(query.position) - } - - private val instance: Rewriter = bottomUp(rewriter, _.isInstanceOf[Expression]) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/projectNamedPaths.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/projectNamedPaths.scala deleted file mode 100644 index a9f57f7f25635..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/projectNamedPaths.scala +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{InternalException, Ref, Rewriter, topDown} -import org.neo4j.cypher.internal.util.v3_5.Foldable.FoldableAny -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.v3_5.expressions._ - -import scala.annotation.tailrec - -case object projectNamedPaths extends Rewriter { - - case class Projectibles(paths: Map[Variable, PathExpression] = Map.empty, - protectedVariables: Set[Ref[LogicalVariable]] = Set.empty, - variableRewrites: Map[Ref[LogicalVariable], PathExpression] = Map.empty) { - - self => - - def withoutNamedPaths = copy(paths = Map.empty) - def withProtectedVariable(ident: Ref[LogicalVariable]) = copy(protectedVariables = protectedVariables + ident) - def withNamedPath(entry: (Variable, PathExpression)) = copy(paths = paths + entry) - def withRewrittenVariable(entry: (Ref[LogicalVariable], PathExpression)) = { - val (ref, pathExpr) = entry - copy(variableRewrites = variableRewrites + (ref -> pathExpr.endoRewrite(copyVariables))) - } - - def returnItems = paths.map { - case (ident, pathExpr) => AliasedReturnItem(pathExpr, ident)(ident.position) - }.toIndexedSeq - - def withVariableRewritesForExpression(expr: Expression) = - expr.treeFold(self) { - case ident: Variable => - acc => - acc.paths.get(ident) match { - case Some(pathExpr) => (acc.withRewrittenVariable(Ref(ident) -> pathExpr), Some(identity)) - case None => (acc, Some(identity)) - } - } - } - - object Projectibles { - val empty = Projectibles() - } - - def apply(input: AnyRef): AnyRef = { - val Projectibles(paths, protectedVariables, variableRewrites) = collectProjectibles(input) - val applicator = Rewriter.lift { - - case (ident: Variable) if !protectedVariables(Ref(ident)) => - variableRewrites.getOrElse(Ref(ident), ident) - - case namedPart@NamedPatternPart(_, _: ShortestPaths) => - namedPart - - case NamedPatternPart(_, part) => - part - - case expr: PathExpression => - expr - } - topDown(applicator)(input) - } - - private def collectProjectibles(input: AnyRef): Projectibles = input.treeFold(Projectibles.empty) { - case aliased: AliasedReturnItem => - acc => - (acc.withProtectedVariable(Ref(aliased.variable)), Some(identity)) - - case ident: Variable => - acc => - acc.paths.get(ident) match { - case Some(pathExpr) => (acc.withRewrittenVariable(Ref(ident) -> pathExpr), Some(identity)) - case None => (acc, Some(identity)) - } - - // Optimization 1 - // - // M p = ... WHERE ..., p, p, ... - // M p = ... WITH a AS a, b AS b, PathExpr AS p WHERE ... - - // Optimization 2 - // - // plan rewriter for pushing projections up the tree - - // TODO: Project for use in WHERE - // TODO: Pull out common subexpressions for path expr using WITH *, ... and run expand star again - // TODO: Plan level rewriting to delay computation of unused projections - - case projection: With => - acc => - val projectedAcc = projection.returnItems.items.map(_.expression).foldLeft(acc) { - (acc, expr) => acc.withVariableRewritesForExpression(expr) - } - (projectedAcc.withoutNamedPaths, Some(identity)) - - case NamedPatternPart(_, part: ShortestPaths) => - acc => (acc, Some(identity)) - - case part @ NamedPatternPart(variable, patternPart) => - acc => - val pathExpr = PathExpression(patternPartPathExpression(patternPart))(part.position) - (acc.withNamedPath(variable -> pathExpr).withProtectedVariable(Ref(variable)), Some(identity)) - } - - def patternPartPathExpression(patternPart: AnonymousPatternPart): PathStep = patternPart match { - case EveryPath(element) => patternPartPathExpression(element) - case x => throw new InternalException(s"Unknown pattern part: $x") - } - - def patternPartPathExpression(element: PatternElement): PathStep = flip(element, NilPathStep) - - @tailrec - private def flip(element: PatternElement, step: PathStep): PathStep = { - element match { - case NodePattern(node, _, _) => - NodePathStep(node.get.copyId, step) - - case RelationshipChain(relChain, RelationshipPattern(rel, _, length, _, direction, _), _) => length match { - case None => - flip(relChain, SingleRelationshipPathStep(rel.get.copyId, direction, step)) - - case Some(_) => - flip(relChain, MultiRelationshipPathStep(rel.get.copyId, direction, step)) - } - } - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/recordScopes.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/recordScopes.scala deleted file mode 100644 index 6bfefa6a8e8f6..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/recordScopes.scala +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, topDown} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticState -import org.neo4j.cypher.internal.v3_5.expressions.{MapProjection, PatternComprehension} - -case class recordScopes(semanticState: SemanticState) extends Rewriter { - - def apply(that: AnyRef): AnyRef = instance.apply(that) - - private val instance: Rewriter = topDown(Rewriter.lift { - case x: PatternComprehension => - x.withOuterScope(semanticState.recordedScopes(x).symbolDefinitions.map(_.asVariable)) - case x: MapProjection => - x.withDefinitionPos(semanticState.recordedScopes(x).symbolTable(x.name.name).definition.position) - }) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/repeatWithSizeLimit.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/repeatWithSizeLimit.scala deleted file mode 100644 index 7b43635ad47ee..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/repeatWithSizeLimit.scala +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, Rewriter} -import org.neo4j.cypher.internal.frontend.v3_5.AstRewritingMonitor -import org.neo4j.cypher.internal.util.v3_5.Foldable.FoldableAny - -import scala.annotation.tailrec -/* -This rewriter tries to limit rewriters that grow the product AST too much - */ -case class repeatWithSizeLimit(rewriter: Rewriter)(implicit val monitor: AstRewritingMonitor) extends Rewriter { - - private def astNodeSize(value: Any): Int = value.treeFold(1) { - case _: ASTNode => acc => (acc + 1, Some(identity)) - } - - final def apply(that: AnyRef): AnyRef = { - val initialSize = astNodeSize(that) - val limit = initialSize * initialSize - - innerApply(that, limit) - } - - @tailrec - private def innerApply(that: AnyRef, limit: Int): AnyRef = { - val t = rewriter.apply(that) - val newSize = astNodeSize(t) - - if (newSize > limit) { - monitor.abortedRewriting(that) - that - } - else if (t == that) { - t - } - else { - innerApply(t, limit) - } - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/replaceAliasedFunctionInvocations.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/replaceAliasedFunctionInvocations.scala deleted file mode 100644 index 6fd3f1dae7e29..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/replaceAliasedFunctionInvocations.scala +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.v3_5.expressions.{FunctionInvocation, FunctionName} - -import scala.collection.immutable.TreeMap - -case object replaceAliasedFunctionInvocations extends Rewriter { - - override def apply(that: AnyRef): AnyRef = instance(that) - - /* - * These are historical names for functions. They are all subject to removal in an upcoming major release. - */ - val aliases: Map[String, String] = TreeMap("toInt" -> "toInteger", - "upper" -> "toUpper", - "lower" -> "toLower", - "rels" -> "relationships")(CaseInsensitiveOrdered) - - val instance: Rewriter = bottomUp(Rewriter.lift { - case func@FunctionInvocation(_, f@FunctionName(name), _, _) if aliases.get(name).nonEmpty => - func.copy(functionName = FunctionName(aliases(name))(f.position))(func.position) - }) - -} - -object CaseInsensitiveOrdered extends Ordering[String] { - def compare(x: String, y: String): Int = - x.compareToIgnoreCase(y) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/replaceLiteralDynamicPropertyLookups.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/replaceLiteralDynamicPropertyLookups.scala deleted file mode 100644 index 81e92c2d97bff..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/replaceLiteralDynamicPropertyLookups.scala +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.v3_5.expressions.{ContainerIndex, Property, PropertyKeyName, StringLiteral} - -case object replaceLiteralDynamicPropertyLookups extends Rewriter { - - private val instance = bottomUp(Rewriter.lift { - case index @ ContainerIndex(expr, lit: StringLiteral) => - Property(expr, PropertyKeyName(lit.value)(lit.position))(index.position) - }) - - override def apply(v: AnyRef): AnyRef = instance(v) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/rewriteEqualityToInPredicate.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/rewriteEqualityToInPredicate.scala deleted file mode 100644 index 2d6e4671a4cc3..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/rewriteEqualityToInPredicate.scala +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.frontend.v3_5.phases.{BaseContext, Condition} -import org.neo4j.cypher.internal.v3_5.expressions._ -import org.neo4j.cypher.internal.v3_5.functions - -case object rewriteEqualityToInPredicate extends StatementRewriter { - - override def description: String = "normalize equality predicates into IN comparisons" - - override def instance(ignored: BaseContext): Rewriter = bottomUp(Rewriter.lift { - // id(a) = value => id(a) IN [value] - case predicate@Equals(func@FunctionInvocation(_, _, _, IndexedSeq(idExpr)), idValueExpr) - if func.function == functions.Id => - In(func, ListLiteral(Seq(idValueExpr))(idValueExpr.position))(predicate.position) - - // Equality between two property lookups should not be rewritten - case predicate@Equals(_:Property, _:Property) => - predicate - - // a.prop = value => a.prop IN [value] - case predicate@Equals(prop@Property(id: Variable, propKeyName), idValueExpr) => - In(prop, ListLiteral(Seq(idValueExpr))(idValueExpr.position))(predicate.position) - }) - - override def postConditions: Set[Condition] = Set.empty -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/transitiveClosure.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/transitiveClosure.scala deleted file mode 100644 index f8594e15e4999..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/rewriters/transitiveClosure.scala +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters - -import org.neo4j.cypher.internal.frontend.v3_5.ast.Where -import org.neo4j.cypher.internal.frontend.v3_5.helpers.fixedPoint -import org.neo4j.cypher.internal.frontend.v3_5.phases.{BaseContext, Condition} -import org.neo4j.cypher.internal.util.v3_5.Foldable._ -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} -import org.neo4j.cypher.internal.v3_5.expressions._ - -import scala.annotation.tailrec - -/** - * Transitive closure of where clauses. - * - * Given a where clause, `WHERE a.prop = b.prop AND b.prop = 42` we rewrite the query - * into `WHERE a.prop = 42 AND b.prop = 42` - */ -case object transitiveClosure extends StatementRewriter { - - override def description: String = "transitive closure in where clauses" - - override def instance(ignored: BaseContext): Rewriter = transitiveClosureRewriter - - override def postConditions: Set[Condition] = Set.empty - - private case object transitiveClosureRewriter extends Rewriter { - - def apply(that: AnyRef): AnyRef = instance.apply(that) - - private val instance: Rewriter = bottomUp(Rewriter.lift { - case where: Where => fixedPoint((w: Where) => w.endoRewrite(whereRewriter))(where) - }) - - //Collects property equalities, e.g `a.prop = 42` - private def collect(e: Expression): Closures = e.treeFold(Closures.empty) { - case _: Or => (acc) => (acc, None) - case _: And => (acc) => (acc, Some(identity)) - case Equals(p1: Property, p2: Property) => (acc) => (acc.withEquivalence(p1 -> p2), None) - case Equals(p: Property, other) => (acc) => (acc.withMapping(p -> other), None) - } - - //NOTE that this might introduce duplicate predicates, however at a later rewrite - //when AND is turned into ANDS we remove all duplicates - private val whereRewriter: Rewriter = bottomUp(Rewriter.lift { - case and@And(lhs, rhs) => - val closures = collect(lhs) ++ collect(rhs) - val inner = andRewriter(closures) - val newAnd = and.copy(lhs = lhs.endoRewrite(inner), rhs = rhs.endoRewrite(inner))(and.position) - - //ALSO take care of case WHERE b.prop = a.prop AND b.prop = 42 - //turns into WHERE b.prop = a.prop AND b.prop = 42 AND a.prop = 42 - closures.emergentEqualities.foldLeft(newAnd) { - case (acc, (prop, expr)) => And(acc, Equals(prop, expr)(acc.position))(acc.position) - } - }) - - private def andRewriter(closures: Closures): Rewriter = bottomUp(Rewriter.lift { - case equals@Equals(p1: Property, p2: Property) if closures.mapping.contains(p2) => - equals.copy(rhs = closures.mapping(p2))(equals.position) - }) - } - - case class Closures(mapping: Map[Property, Expression] = Map.empty, - equivalence: Map[Property, Property] = Map.empty) { - - def withMapping(e:(Property,Expression)): Closures = copy(mapping = mapping + e) - def withEquivalence(e:(Property,Property)): Closures = copy(equivalence = equivalence + e ) - - def emergentEqualities: Map[Property, Expression] = { - val sharedKeys = equivalence.keySet.intersect(mapping.keySet) - - sharedKeys.map(k => equivalence(k) -> mapping(k)).toMap -- mapping.keySet - } - - def ++(other: Closures): Closures = copy(mapping ++ other.mapping, equivalence ++ other.equivalence) - } - - object Closures { - def empty = Closures() - } - -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/PartialFunctionSupport.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/PartialFunctionSupport.scala deleted file mode 100644 index 24075953617a2..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/PartialFunctionSupport.scala +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.helpers - -import scala.reflect.ClassTag - -object PartialFunctionSupport { - - def reduceAnyDefined[A, B](functions: Seq[PartialFunction[A, B]])(init: B)(combine: (B, B) => B) = foldAnyDefined[A, B, B](functions)(init)(combine) - - def foldAnyDefined[A, B, C](functions: Seq[PartialFunction[A, B]])(init: C)(combine: (C, B) => C): PartialFunction[A, C] = new PartialFunction[A, C] { - override def isDefinedAt(v: A) = functions.exists(_.isDefinedAt(v)) - override def apply(v: A) = functions.foldLeft(init)((acc, pf) => if (pf.isDefinedAt(v)) combine(acc, pf(v)) else acc) - } - - def composeIfDefined[A](functions: Seq[PartialFunction[A, A]]) = new PartialFunction[A, A] { - override def isDefinedAt(v: A): Boolean = functions.exists(_.isDefinedAt(v)) - override def apply(init: A): A = functions.foldLeft[Option[A]](None)({ (current: Option[A], pf: PartialFunction[A, A]) => - val v = current.getOrElse(init) - if (pf.isDefinedAt(v)) Some(pf(v)) else current - }).get - } - - def uplift[A: ClassTag, B, S >: A](f: PartialFunction[A, B]): PartialFunction[S, B] = { - case v: A if f.isDefinedAt(v) => f(v) - } - - def fix[A, B](f: PartialFunction[A, PartialFunction[A, B] => B]): PartialFunction[A, B] = new fixedPartialFunction(f) - - class fixedPartialFunction[-A, +B](f: PartialFunction[A, PartialFunction[A, B] => B]) extends PartialFunction[A, B] { - def isDefinedAt(v: A) = f.isDefinedAt(v) - def apply(v: A) = f(v)(this) - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/SeqCombiner.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/SeqCombiner.scala deleted file mode 100644 index 56033e0e1805a..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/SeqCombiner.scala +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.helpers - -object SeqCombiner { - /** - * Combines each element in the inner Seq's with one element of every other inner Seq. - * - * scala> combine(List(List("A", "B", "C"), List(1,2,3), List("x", "y", "z"))) - res0: Seq[Seq[Any]] = List( - List(A, 1, x), - List(A, 1, y), - List(A, 1, z), - List(A, 2, x), - List(A, 2, y), - List(A, 2, z), - List(A, 3, x), - List(A, 3, y), - List(A, 3, z), - List(B, 1, x), - List(B, 1, y), - List(B, 1, z), - List(B, 2, x), - List(B, 2, y), - List(B, 2, z), - List(B, 3, x), - List(B, 3, y), - List(B, 3, z), - List(C, 1, x), - List(C, 1, y), - List(C, 1, z), - List(C, 2, x), - List(C, 2, y), - List(C, 2, z), - List(C, 3, x), - List(C, 3, y), - List(C, 3, z)) - */ - def combine[A](xs: Traversable[Traversable[A]]): Seq[Seq[A]] = - xs.foldLeft(Seq(Seq.empty[A])) { - (x, y) => for (a <- x; b <- y) yield a :+ b - } - -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/StringHelper.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/StringHelper.scala deleted file mode 100644 index ea02bba31f997..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/StringHelper.scala +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.helpers - -import org.apache.commons.lang3.SystemUtils - -object StringHelper { - private val positionPattern = """\(line (\d+), column (\d+) \(offset: (\d+)\)\)""".r - - implicit class RichString(val text: String) extends AnyVal { - def stripLinesAndMargins: String = - text.stripMargin.filter((ch: Char) => Character.isDefined(ch) && !Character.isISOControl(ch)) - - def cypherEscape: String = - text.replace("\\", "\\\\") - - def fixNewLines: String = text.replaceAll("\r\n", "\n") - - // (line 1, column 8 (offset: 7)) - def fixPosition: String = if (SystemUtils.IS_OS_WINDOWS) { - positionPattern.replaceAllIn(text, (matcher) => { - val line = matcher.group(1).toInt - val column = matcher.group(2).toInt - val offset = matcher.group(3).toInt + line - 1 - s"(line $line, column $column (offset: $offset))" - } ) - } else { text } - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/TreeZipper.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/TreeZipper.scala deleted file mode 100644 index c60f7e247ed70..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/TreeZipper.scala +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.helpers - -import scala.annotation.tailrec -import scala.reflect.ClassTag - -trait TreeElem[E <: TreeElem[E]] { - self: E => - - def children: Seq[E] - def updateChildren(newChildren: Seq[E]): E - def location(implicit zipper: TreeZipper[E]) = zipper(self) -} - -abstract class TreeZipper[E <: TreeElem[E] : ClassTag] { - - def apply(treeElem: E) = Location(treeElem, Top) - - sealed trait Context - case object Top extends Context - case class TreeContext(left: List[E], parent: Location, right: List[E]) extends Context - - object Children { - def unapply(v: Any) = implicitly[ClassTag[E]].unapply(v).map(_.children) - } - - final case class Location(elem: E, context: Context) { - self => - - def isRoot = context == Top - - def isLeaf = self match { - case Location(Children(Nil), _) => true - case _ => false - } - - @tailrec - def root: Location = self match { - case Location(_, Top) => - self - - case Location(_, TreeContext(left, Location(parentElem, parentContext), right)) => - Location(parentElem.updateChildren(left.reverse ++ List(elem) ++ right), parentContext).root - } - - def isLeftMost = context match { - case TreeContext(Nil, _, _) => true - case Top => true - case _ => false - } - - def left: Option[Location] = context match { - case TreeContext(Nil, _, _) => - None - - case TreeContext(head :: tail, parent, right) => - Some(Location(head, TreeContext(tail, parent, elem +: right))) - - case _ => - throw new IllegalStateException("Not in tree context when going left") - } - - def leftMost: Location = context match { - case TreeContext(Nil, _, _) => - self - - case TreeContext(left, parent, right) => - Location(left.last, TreeContext(List.empty, parent, left.init.reverse ++ List(elem) ++ right)) - - case otherContext => - throw new IllegalStateException(s"Cannot navigate from $otherContext") - } - - def isRightMost = context match { - case TreeContext(_, _, Nil) => true - case Top => true - case _ => false - } - - def right: Option[Location] = context match { - case TreeContext(_, _, Nil) => - None - - case TreeContext(left, parent, head :: tail) => - Some(Location(head, TreeContext(elem +: left, parent, tail))) - - case _ => - throw new IllegalStateException("Not in tree context when going left") - } - - def rightMost: Location = context match { - case TreeContext(_, _, Nil) => - self - - case TreeContext(left, parent, right) => - Location(right.last, TreeContext(right.init.reverse ++ List(elem) ++ left, parent, List.empty)) - - case otherContext => - throw new IllegalStateException(s"Cannot navigate from $otherContext") - } - - def down: Option[Location] = self match { - case Location(Children(Nil), _) => - None - - case Location(Children(Seq(head, tail @ _*)), _) => - Some(Location(head, TreeContext(Nil, self, tail.toList))) - } - - def up: Option[Location] = self match { - case Location(_, Top) => - None - - case Location(_, TreeContext(left, Location(parentElem, parentContext), right)) => - Some(Location(parentElem.updateChildren(left.reverse ++ List(elem) ++ right), parentContext)) - } - - def replace(newElem: E): Location = - Location(newElem, context) - - def insertLeft(newElem: E): Option[Location] = self match { - case Location(_, Top) => - None - - case Location(tree, TreeContext(left, parent, right)) => - Some(Location(newElem, TreeContext(left, parent, tree +: right))) - } - - def insertRight(newElem: E): Option[Location] = self match { - case Location(_, Top) => - None - - case Location(_, TreeContext(left, parent, right)) => - Some(Location(newElem, TreeContext(elem +: left, parent, right))) - } - - def insertChild(newElem: E): Location = - Location(newElem, TreeContext(elem.children.toList.reverse, self, List.empty)) - } - - implicit final class OptionalLocation(location: Option[Location]) { - def elem = location.map(_.elem) - - def isRoot = location.map(_.isRoot) - def isLeaf = location.map(_.isLeaf) - - def root = location.map(_.root) - - def isLeftMost = location.map(_.isLeftMost) - def left = location.flatMap(_.left) - def leftMost = location.map(_.leftMost) - - def isRightMost = location.map(_.isLeftMost) - def right = location.flatMap(_.right) - def rightMost = location.map(_.rightMost) - - def down = location.flatMap(_.down) - def up = location.flatMap(_.up) - - def replace(replacementElem: E) = location.map(_.replace(replacementElem)) - def insertLeft(newElem: E) = location.flatMap(_.insertLeft(newElem)) - def insertRight(newElem: E) = location.flatMap(_.insertRight(newElem)) - def insertChild(newElem: E) = location.map(_.insertChild(newElem)) - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/calculateUsingGetDegree.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/calculateUsingGetDegree.scala deleted file mode 100644 index 79db21b295429..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/calculateUsingGetDegree.scala +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.helpers - -import org.neo4j.cypher.internal.v3_5.expressions._ - -/* - * Calculates how to transform a pattern (a)-[:R1:R2...]->() to getDegree call - * of that very pattern. - */ -object calculateUsingGetDegree { - - def apply(expr: Expression, node: LogicalVariable, types: Seq[RelTypeName], dir: SemanticDirection): Expression = { - types - .map(typ => GetDegree(node.copyId, Some(typ), dir)(typ.position)) - .reduceOption[Expression](Add(_, _)(expr.position)) - .getOrElse(GetDegree(node, None, dir)(expr.position)) - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/fixedPoint.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/fixedPoint.scala deleted file mode 100644 index 165d31f1a6bc2..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/fixedPoint.scala +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.helpers - -import scala.annotation.tailrec - -object fixedPoint { - - def apply[A](f: A => A): A => A = inner(f, _) - - @tailrec - private def inner[A](f: A => A, that: A): A = { - val t = f(that) - if (t == that) - t - else - inner(f, t) - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/package.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/package.scala deleted file mode 100644 index 6919f86be1529..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/package.scala +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5 - -package object helpers { - - def closing[Resource <: AutoCloseable, Result](resource: Resource)(block: => Result)( - implicit onSuccess: Resource => Unit = (r: Resource) => {}, - onError: (Resource, Throwable) => Unit = (r: Resource, t: Throwable) => {}): Result = { - using(resource){ _ => block } - } - - def using[Resource <: AutoCloseable, Result](resource: Resource)(block: Resource => Result)( - implicit onSuccess: Resource => Unit = (r: Resource) => {}, - onError: (Resource, Throwable) => Unit = (r: Resource, t: Throwable) => {}): Result = { - var failure = false - try { - block(resource) - } catch { - case f: Throwable => - failure = true - try { - try { - onError(resource, f) - } finally { - resource.close() - } - } catch { - case sub: Throwable => - f.addSuppressed(sub) - } - throw f - } finally { - if(!failure) { - try { - onSuccess(resource) - } finally { - resource.close() - } - } - } - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterCondition.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterCondition.scala deleted file mode 100644 index 480bf65b74b0b..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterCondition.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting - -final case class RewriterCondition(name: String, condition: Any => Seq[String]) - extends (Any => Option[RewriterConditionFailure]) { - - def apply(input: Any): Option[RewriterConditionFailure] = { - val conditions = condition(input) - if (conditions.isEmpty) None else Some(RewriterConditionFailure(name, conditions)) - } -} - -case class RewriterConditionFailure(name: String, problems: Seq[String]) diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterStep.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterStep.scala deleted file mode 100644 index 15a47c1ad0614..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterStep.scala +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting - -import org.neo4j.cypher.internal.util.v3_5.Rewriter - -object RewriterStep { - implicit def namedProductRewriter(p: Product with Rewriter): ApplyRewriter = ApplyRewriter(p.productPrefix, p) - - def enableCondition(p: Condition) = EnableRewriterCondition(RewriterCondition(p.name, p)) - def disableCondition(p: Condition) = DisableRewriterCondition(RewriterCondition(p.name, p)) - } - -sealed trait RewriterStep -final case class ApplyRewriter(name: String, rewriter: Rewriter) extends RewriterStep -final case class EnableRewriterCondition(cond: RewriterCondition) extends RewriterStep -final case class DisableRewriterCondition(cond: RewriterCondition) extends RewriterStep - -trait Condition extends (Any => Seq[String]) { - def name: String -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterStepSequencer.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterStepSequencer.scala deleted file mode 100644 index 8fa338b857ab9..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterStepSequencer.scala +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, inSequence} -import org.neo4j.cypher.internal.frontend.v3_5._ - -import scala.collection.mutable - -case class RewriterContract(childRewriters: Seq[Rewriter], postConditions: Set[RewriterCondition]) { - val rewriter = inSequence(childRewriters: _*) -} - -object RewriterStepSequencer { - def newPlain(sequenceName: String) = - PlainRewriterStepSequencer(sequenceName, DefaultRewriterTaskProcessor(sequenceName)) - - def newValidating(sequenceName: String) = - ValidatingRewriterStepSequencer(sequenceName, DefaultRewriterTaskProcessor(sequenceName)) - - def newTracing(sequenceName: String, onlyIfChanged: Boolean = true) = - ValidatingRewriterStepSequencer(sequenceName, TracingRewriterTaskProcessor(sequenceName, onlyIfChanged)) -} - -trait RewriterStepSequencer extends ((RewriterStep *) => RewriterContract) { - self => - - private val _steps: mutable.Builder[RewriterStep, Seq[RewriterStep]] = Seq.newBuilder - - def withPrecondition(conditions: Set[RewriterCondition]) = { - conditions.foldLeft(_steps) { (acc, cond) => acc += EnableRewriterCondition(cond) } - self - } - - def apply(steps: RewriterStep*): RewriterContract = - internalResult(steps.foldLeft(_steps) { (acc, step) => acc += step }.result()) - - protected def internalResult(steps: Seq[RewriterStep]): RewriterContract -} - -case class PlainRewriterStepSequencer(sequenceName: String, taskProcessor: RewriterTaskProcessor) extends RewriterStepSequencer { - - protected def internalResult(steps: Seq[RewriterStep]): RewriterContract = { - val rewriters = steps.collect { case ApplyRewriter(name, rewriter) => taskProcessor(RunRewriter(name, rewriter)) } - RewriterContract(rewriters, Set.empty) - } -} - -case class ValidatingRewriterStepSequencer(sequenceName: String, taskProcessor: RewriterTaskProcessor) extends RewriterStepSequencer { - - protected def internalResult(steps: Seq[RewriterStep]): RewriterContract = { - val tasks = RewriterTaskBuilder(steps) - val rewriters = tasks.map(taskProcessor) - val postConditions = tasks.lastOption.collect { case task: RunConditions => task.conditions }.getOrElse(Set.empty) - RewriterContract(rewriters, postConditions) - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterTask.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterTask.scala deleted file mode 100644 index 20f6940962d0e..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterTask.scala +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting - -import org.neo4j.cypher.internal.util.v3_5.Rewriter - -sealed trait RewriterTask -final case class RunConditions(previousName: Option[String], conditions: Set[RewriterCondition]) extends RewriterTask -final case class RunRewriter(name: String, rewriter: Rewriter) extends RewriterTask diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterTaskBuilder.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterTaskBuilder.scala deleted file mode 100644 index fe17c7f303348..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterTaskBuilder.scala +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting - -import org.neo4j.cypher.internal.util.v3_5.Rewriter - -case object RewriterTaskBuilder { - - private case class State(conditions: Set[RewriterCondition] = Set.empty, - previousName: Option[String] = None, - tasks: Seq[RewriterTask] = Seq.empty) { - def +(name: String, rewriter: Rewriter) = - copy(previousName = Some(name), tasks = allTasks :+ RunRewriter(name, rewriter)) - def +(condition: RewriterCondition) = copy(conditions = conditions + condition) - def -(condition: RewriterCondition) = copy(conditions = conditions - condition) - def allTasks = if (conditions.isEmpty) tasks else tasks :+ RunConditions(previousName, conditions) - } - - def apply(steps: Seq[RewriterStep]): Seq[RewriterTask] = steps.foldLeft(State()) { - case (state, ApplyRewriter(name, rewriter)) => state +(name, rewriter) - case (state, EnableRewriterCondition(condition)) => state + condition - case (state, DisableRewriterCondition(condition)) => state - condition - }.allTasks -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterTaskProcessor.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterTaskProcessor.scala deleted file mode 100644 index 9121a24cab0eb..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterTaskProcessor.scala +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting - -import org.neo4j.cypher.internal.util.v3_5.{InternalException, Rewriter} - -trait RewriterTaskProcessor extends (RewriterTask => Rewriter) { - def sequenceName: String - - def apply(task: RewriterTask): Rewriter = task match { - case RunConditions(name, conditions) => RunConditionRewriter(sequenceName, name, conditions) - case RunRewriter(_, rewriter) => rewriter - } -} - -case class RunConditionRewriter(sequenceName: String, name: Option[String], conditions: Set[RewriterCondition]) extends Rewriter { - def apply(input: AnyRef): AnyRef = { - val failures = conditions.toIndexedSeq.flatMap(condition => condition(input)) - if (failures.isEmpty) { - input - } else { - throw new RewritingConditionViolationException(name, failures) - } - } - - case class RewritingConditionViolationException(optName: Option[String], failures: Seq[RewriterConditionFailure]) - extends InternalException(buildMessage(sequenceName, optName, failures)) - - private def buildMessage(sequenceName: String, optName: Option[String], failures: Seq[RewriterConditionFailure]) = { - val name = optName.map(name => s"step '$name'").getOrElse("start of rewriting") - val builder = new StringBuilder - builder ++= s"Error during '$sequenceName' rewriting after $name. The following conditions where violated: \n" - for (failure <- failures ; - problem <- failure.problems) { - builder ++= s"Condition '${failure.name}' violated. $problem\n" - } - builder.toString() - } -} - -case class DefaultRewriterTaskProcessor(sequenceName: String) extends RewriterTaskProcessor - -case class TracingRewriterTaskProcessor(sequenceName: String, onlyWhenChanged: Boolean) extends RewriterTaskProcessor { - - override def apply(task: RewriterTask) = task match { - case RunRewriter(name, _) => - val innerRewriter = super.apply(task) - (in) => - val result = innerRewriter(in) - if (!onlyWhenChanged || in != result) { -// val resultDoc = pprintToDoc[AnyRef, Any](Result(result))(ResultHandler.docGen) -// val resultString = printCommandsToString(DocFormatters.defaultFormatter(resultDoc)) - val resultString = result.toString - Console.print(s"*** $name ($sequenceName):$resultString\n") - } else { - Console.print(s"*** $name ($sequenceName):\n--\n") - } - result - - case _ => - super.apply(task) - } -} -// -//object TracingRewriterTaskProcessor { -// import Pretty._ -// -// object ResultHandler extends CustomDocHandler[Any] { -// def docGen = resultDocGen orElse InternalDocHandler.docGen -// } -// -// object resultDocGen extends CustomDocGen[Any] { -// def apply[X <: Any : TypeTag](x: X): Option[DocRecipe[Any]] = x match { -// case Result(result) => Pretty(page(nestWith(indent = 2, group(break :: group(pretty(result)))))) -// case _ => None -// } -// } -// -// case class Result(v: Any) -//} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/notification/InternalNotification.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/notification/InternalNotification.scala deleted file mode 100644 index 6dd45d33ce0da..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/notification/InternalNotification.scala +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.notification - -import org.neo4j.cypher.internal.util.v3_5.InputPosition - -/** - * Describes a notification - */ -sealed trait InternalNotification - -case class DeprecatedStartNotification(position: InputPosition, alternativeQuery: String) extends InternalNotification - -case class CartesianProductNotification(position: InputPosition, isolatedVariables: Set[String]) extends InternalNotification - -case class LengthOnNonPathNotification(position: InputPosition) extends InternalNotification - -case object PlannerUnsupportedNotification extends InternalNotification - -case object RuntimeUnsupportedNotification extends InternalNotification - -case class IndexHintUnfulfillableNotification(label: String, propertyKeys: Seq[String]) extends InternalNotification - -case class JoinHintUnfulfillableNotification(identified: Seq[String]) extends InternalNotification - -case class JoinHintUnsupportedNotification(identified: Seq[String]) extends InternalNotification - -case class IndexLookupUnfulfillableNotification(labels: Set[String]) extends InternalNotification - -case object EagerLoadCsvNotification extends InternalNotification - -case object LargeLabelWithLoadCsvNotification extends InternalNotification - -case class MissingLabelNotification(position: InputPosition, label: String) extends InternalNotification - -case class MissingRelTypeNotification(position: InputPosition, relType: String) extends InternalNotification - -case class MissingPropertyNameNotification(position: InputPosition, name: String) extends InternalNotification - -case class UnboundedShortestPathNotification(position: InputPosition) extends InternalNotification - -case class ExhaustiveShortestPathForbiddenNotification(position: InputPosition) extends InternalNotification - -case class DeprecatedFunctionNotification(position: InputPosition, oldName: String, newName: String) extends InternalNotification - -case class DeprecatedProcedureNotification(position: InputPosition, oldName: String, newName: String) extends InternalNotification - -case class ProcedureWarningNotification(position: InputPosition, procedure: String, warning: String) extends InternalNotification - -case class DeprecatedFieldNotification(position: InputPosition, procedure: String, field: String) extends InternalNotification - -case class DeprecatedVarLengthBindingNotification(position: InputPosition, variable: String) extends InternalNotification - -case class DeprecatedRelTypeSeparatorNotification(position: InputPosition) extends InternalNotification - -case object DeprecatedPlannerNotification extends InternalNotification - -case class ExperimentalFeatureNotification(msg: String) extends InternalNotification diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/package.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/package.scala deleted file mode 100644 index 970730def10e5..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/package.scala +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend - -import org.neo4j.cypher.internal.frontend.v3_5.semantics._ -import org.neo4j.cypher.internal.util.v3_5.symbols.TypeSpec - -import scala.language.implicitConversions - -package object v3_5 { - - type SemanticCheck = SemanticState => SemanticCheckResult - type TypeGenerator = SemanticState => TypeSpec - - // Allows joining of two (SemanticState => SemanticCheckResult) funcs together (using then) - implicit def chainableSemanticCheck(check: SemanticCheck): ChainableSemanticCheck = new ChainableSemanticCheck(check) - - // Allows joining of a (SemanticState => SemanticCheckResult) func to a (SemanticState => Either[SemanticErrorDef, SemanticState]) func - implicit def chainableSemanticEitherFunc(func: SemanticState => Either[SemanticErrorDef, SemanticState]): ChainableSemanticCheck = new ChainableSemanticCheck(func) - - // Allows joining of a (SemanticState => SemanticCheckResult) func to a (SemanticState => Seq[SemanticErrorDef]) func - implicit def chainableSemanticErrorDefsFunc(func: SemanticState => Seq[SemanticErrorDef]): ChainableSemanticCheck = new ChainableSemanticCheck(func) - - // Allows joining of a (SemanticState => SemanticCheckResult) func to a (SemanticState => Option[SemanticErrorDef]) func - implicit def chainableSemanticOptionFunc(func: SemanticState => Option[SemanticErrorDef]): ChainableSemanticCheck = new ChainableSemanticCheck(func) - - // Allows using a (SemanticState => Either[SemanticErrorDef, SemanticState]) func, where a (SemanticState => SemanticCheckResult) func is expected - implicit def liftSemanticEitherFunc(func: SemanticState => Either[SemanticErrorDef, SemanticState]): SemanticCheck = state => { - func(state).fold(error => SemanticCheckResult.error(state, error), s => SemanticCheckResult.success(s)) - } - - // Allows using a (SemanticState => Seq[SemanticErrorDef]) func, where a (SemanticState => SemanticCheckResult) func is expected - implicit def liftSemanticErrorDefsFunc(func: SemanticState => Seq[SemanticErrorDef]): SemanticCheck = state => { - SemanticCheckResult(state, func(state)) - } - - // Allows using a (SemanticState => Option[SemanticErrorDef]) func, where a (SemanticState => SemanticCheckResult) func is expected - implicit def liftSemanticErrorDefFunc(func: SemanticState => Option[SemanticErrorDef]): SemanticCheck = state => { - SemanticCheckResult.error(state, func(state)) - } - - // Allows using a sequence of SemanticErrorDef, where a (SemanticState => SemanticCheckResult) func is expected - implicit def liftSemanticErrorDefs(errors: Seq[SemanticErrorDef]): SemanticCheck = SemanticCheckResult(_, errors) - - // Allows using a single SemanticErrorDef, where a (SemanticState => SemanticCheckResult) func is expected - implicit def liftSemanticErrorDef(error: SemanticErrorDef): SemanticCheck = SemanticCheckResult.error(_, error) - - // Allows using an optional SemanticErrorDef, where a (SemanticState => SemanticCheckResult) func is expected - implicit def liftSemanticErrorDefOption(error: Option[SemanticErrorDef]): SemanticCheck = SemanticCheckResult.error(_, error) - - // Allows starting with a sequence of SemanticErrorDef, and joining to a (SemanticState => SemanticCheckResult) func (using then) - implicit def liftSemanticErrorDefsAndChain(errors: Seq[SemanticErrorDef]): ChainableSemanticCheck = liftSemanticErrorDefs(errors) - - // Allows starting with a single SemanticErrorDef, and joining to a (SemanticState => SemanticCheckResult) func (using then) - implicit def liftSemanticErrorDefAndChain(error: SemanticErrorDef): ChainableSemanticCheck = liftSemanticErrorDef(error) - - // Allows starting with an optional SemanticErrorDef, and joining to a (SemanticState => SemanticCheckResult) func (using then) - implicit def liftSemanticErrorDefOptionAndChain(error: Option[SemanticErrorDef]): ChainableSemanticCheck = liftSemanticErrorDefOption(error) - - // Allows folding a semantic checking func over a collection - implicit def optionSemanticChecking[A](option: Option[A]): OptionSemanticChecking[A] = new OptionSemanticChecking(option) - - implicit def traversableOnceSemanticChecking[A](traversable: TraversableOnce[A]): TraversableOnceSemanticChecking[A] = new TraversableOnceSemanticChecking(traversable) - - // Allows calling semanticCheck on an optional SemanticCheckable object - implicit def semanticCheckableOption[A <: SemanticCheckable](option: Option[A]): SemanticCheckableOption[A] = new SemanticCheckableOption(option) - - // Allows calling semanticCheck on a traversable sequence of SemanticCheckable objects - implicit def semanticCheckableTraversableOnce[A <: SemanticCheckable](traversable: TraversableOnce[A]): SemanticCheckableTraversableOnce[A] = new SemanticCheckableTraversableOnce(traversable) - - implicit final class RichSemanticCheck(val check: SemanticCheck) extends AnyVal { - - // Only run a check if a given feature is enabled - def ifFeatureEnabled(feature: SemanticFeature): SemanticCheck = - (s: SemanticState) => if(s.features(feature)) check(s) else SemanticCheckResult.success(s) - - // Only run a check if a given feature is *not* enabled - def unlessFeatureEnabled(feature: SemanticFeature): SemanticCheck = - (s: SemanticState) => if(!s.features(feature)) check(s) else SemanticCheckResult.success(s) - } -} - diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Base.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Base.scala deleted file mode 100644 index 4a992cfff11dd..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Base.scala +++ /dev/null @@ -1,270 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.util.v3_5.{InputPosition, InternalException, SyntaxException} -import org.neo4j.cypher.internal.v3_5.expressions.{Namespace => ASTNamespace} -import org.parboiled.Context -import org.parboiled.errors.{InvalidInputError, ParseError} -import org.parboiled.scala._ -import org.parboiled.support.IndexRange - -trait Base extends Parser { - - def OpChar = rule("an operator char") { anyOf("|^&<>=?!:+-*/%~") } - def OpCharTail = rule("an operator char") { anyOf("|^&<>=?!:*/%~") } - - def DecimalInteger = rule { (optional("-") ~ UnsignedDecimalInteger).memoMismatches } - def UnsignedDecimalInteger = rule { (group(("1" - "9") ~ optional(DigitString)) | "0").memoMismatches } - def RegularDecimalReal = rule { (optional("-") ~ zeroOrMore("0" - "9") ~ "." ~ DigitString).memoMismatches } - def ExponentDecimalReal = rule { (optional("-") ~ oneOrMore("0" - "9" | ".") ~ (ch('e') | ch('E')) ~ optional("-") ~ DigitString).memoMismatches } - def DigitString = rule("'0'-'9'") { oneOrMore(IdentifierPart) ~ !IdentifierPart } - def OctalInteger = rule { (optional("-") ~ UnsignedOctalInteger).memoMismatches } - def UnsignedOctalInteger = rule { ("0" ~ OctalString).memoMismatches } - def OctalString = rule("'0'-'7'") { oneOrMore(IdentifierPart) ~ !IdentifierPart } - def HexInteger = rule { (optional("-") ~ UnsignedHexInteger).memoMismatches } - def UnsignedHexInteger = rule { ("0x" ~ HexString).memoMismatches } - def HexString = rule("'0'-'9', 'a'-'f'") { oneOrMore(IdentifierPart) ~ !IdentifierPart } - - def Dash = rule("'-'") { - // U+002D ‑ hyphen-minus - // U+00AD - soft hyphen - // U+2010 - hyphen - // U+2011 ‐ non-breaking hyphen - // U+2012 ‒ figure dash - // U+2013 – en dash - // U+2014 — em dash - // U+2015 ― horizontal bar - // U+2212 − minus sign - // U+FE58 ﹘ small em dash - // U+FE63 ﹣ small hyphen-minus - // U+FF0D - full-width hyphen-minus - anyOf(Array('\u002d', '\u00ad', '\u2010', '\u2011', '\u2012', '\u2013', '\u2014', '\u2015', '\u2212', '\ufe58', '\ufe63', '\uff0d')) - } - def LeftArrowHead = rule("'<'") { - // U+003c < less-than sign - // U+27e8 ⟨ mathematical left angle bracket - // U+3008 〈 left angle bracket - // U+fe64 ﹤ small less-than sign - // U+ff1c < full-width less-than sign - anyOf(Array('\u003c', '\u27e8', '\u3008', '\ufe64', '\uff1c')) - } - def RightArrowHead = rule("'>'") { - // U+003e > greater-than sign - // U+27e9 ⟩ mathematical left angle bracket - // U+3009 〉 right angle bracket - // U+fe65 ﹥ small greater-than sign - // U+ff1e > full-width greater-than sign - anyOf(Array('\u003e', '\u27e9', '\u3009', '\ufe65', '\uff1e')) - } - - def CommaSep = rule("','") { WS ~ ch(',') ~ WS } - - def WS = rule("whitespace") { - zeroOrMore( - (oneOrMore(WSChar) memoMismatches) - | (ch('/').label("comment") ~ ( - ch('*') ~ zeroOrMore(!"*/" ~ ANY) ~ "*/" - | ch('/') ~ zeroOrMore(!anyOf("\n\r") ~ ANY) ~ (optional(ch('\r')) ~ ch('\n') | EOI) - ) memoMismatches) - ) - }.suppressNode - - def keyword(string: String): Rule0 = { - def word(string: String): Rule0 = group(ignoreCase(string).label(string.toUpperCase) ~ !IdentifierPart) - val strings = string.trim.split(' ') - group(strings.tail.foldLeft(word(strings.head)) { - (acc, s) => acc ~ WS ~ word(s) - }) - } - def operator(string: String) = group(string ~ !OpCharTail) - - def push[R](f: InputPosition => R): Rule1[R] = pushFromContext(ctx => f(ContextPosition(ctx))) - - def position = withContext((_: IndexRange, ctx: Context[Any]) => ContextPosition(ctx)) - - def SymbolicNameString: Rule1[String] = UnescapedSymbolicNameString | EscapedSymbolicNameString - - def UnescapedSymbolicNameString: Rule1[String] = rule("an identifier") { - group(IdentifierStart ~ zeroOrMore(IdentifierPart)) ~> (_.toString) ~ !IdentifierPart - } - - def EscapedSymbolicNameString: Rule1[String] = rule("an identifier") { - (oneOrMore( - ch('`') ~ zeroOrMore(!ch('`') ~ ANY) ~> (_.toString) ~ ch('`') - ) memoMismatches) ~~> (_.reduce(_ + '`' + _)) - } - - def Namespace: Rule1[ASTNamespace] = rule("namespace of a procedure") { - zeroOrMore(SymbolicNameString ~ ".") ~~>> (ASTNamespace(_)) - } - - def parseOrThrow[T](input: String, initialOffset: Option[InputPosition], rule: Rule1[Seq[T]]): T = { - val parsingResults = ReportingParseRunner(rule).run(input) - parsingResults.result match { - case Some(statements) => - if (statements.size == 1) { - val statement = statements.head - statement - } else { - throw new SyntaxException(s"Expected exactly one statement per query but got: ${statements.size}") - } - case _ => - val parseErrors: List[ParseError] = parsingResults.parseErrors - parseErrors.map { error => - val message = if (error.getErrorMessage != null) { - error.getErrorMessage - } else { - error match { - case invalidInput: InvalidInputError => new InvalidInputErrorFormatter().format(invalidInput) - case _ => error.getClass.getSimpleName - } - } - - val bufferPosition = BufferPosition(error.getInputBuffer, error.getStartIndex) - val position = bufferPosition.withOffset(initialOffset) - throw new SyntaxException(s"$message ($position)", input, position) - } - - throw new InternalException("Parsing failed but no parse errors were provided") - } - } - - implicit class RichRule0(r: Rule0) { - def ~~(other: Rule0): Rule0 = r ~ WS ~ other - def ~~[A](other: Rule1[A]): Rule1[A] = r ~ WS ~ other - def ~~[A, B](other: Rule2[A, B]): Rule2[A, B] = r ~ WS ~ other - def ~~[A, B, C](other: Rule3[A, B, C]): Rule3[A, B, C] = r ~ WS ~ other - def ~~[A, B, C, D](other: Rule4[A, B, C, D]): Rule4[A, B, C, D] = r ~ WS ~ other - def ~~[A, B, C, D, E](other: Rule5[A, B, C, D, E]): Rule5[A, B, C, D, E] = r ~ WS ~ other - def ~~[A, B, C, D, E, F](other: Rule6[A, B, C, D, E, F]): Rule6[A, B, C, D, E, F] = r ~ WS ~ other - def ~~[A, B, C, D, E, F, G](other: Rule7[A, B, C, D, E, F, G]): Rule7[A, B, C, D, E, F, G] = r ~ WS ~ other - - def ~~[A, B](other: ReductionRule1[A, B]): ReductionRule1[A, B] = r ~ WS ~ other - def ~~[A, B, C](other: ReductionRule2[A, B, C]): ReductionRule2[A, B, C] = r ~ WS ~ other - - def ~>>>[R](f: String => InputPosition => R): Rule1[R] = r ~> withContext((s: String, ctx) => f(s)(ContextPosition(ctx))) - def ~~>>[Z, R](f: (Z) => (InputPosition => R)): ReductionRule1[Z, R] = - r ~~> withContext((z: Z, ctx) => f(z)(ContextPosition(ctx))) - def ~~>>[Y, Z, R](f: (Y, Z) => (InputPosition => R)): ReductionRule2[Y, Z, R] = - r ~~> withContext((y: Y, z: Z, ctx) => f(y, z)(ContextPosition(ctx))) - def ~~~>[R](f: InputPosition => R): Rule1[R] = r ~> withContext((_, ctx) => f(ContextPosition(ctx))) - } - - implicit class RichString(s: String) { - def ~~(other: Rule0): Rule0 = s ~ WS ~ other - def ~~[A](other: String): Rule0 = s ~ WS ~ other - def ~~[A](other: Rule1[A]): Rule1[A] = s ~ WS ~ other - def ~~[A, B](other: Rule2[A, B]): Rule2[A, B] = s ~ WS ~ other - def ~~[A, B, C](other: Rule3[A, B, C]): Rule3[A, B, C] = s ~ WS ~ other - def ~~[A, B, C, D](other: Rule4[A, B, C, D]): Rule4[A, B, C, D] = s ~ WS ~ other - def ~~[A, B, C, D, E](other: Rule5[A, B, C, D, E]): Rule5[A, B, C, D, E] = s ~ WS ~ other - def ~~[A, B, C, D, E, F](other: Rule6[A, B, C, D, E, F]): Rule6[A, B, C, D, E, F] = s ~ WS ~ other - def ~~[A, B, C, D, E, F, G](other: Rule7[A, B, C, D, E, F, G]): Rule7[A, B, C, D, E, F, G] = s ~ WS ~ other - - def ~~[A, B](other: ReductionRule1[A, B]): ReductionRule1[A, B] = s ~ WS ~ other - def ~~[A, B, C](other: ReductionRule2[A, B, C]): ReductionRule2[A, B, C] = s ~ WS ~ other - } - - implicit class RichRule1[+A](r: Rule1[A]) { - def ~~(other: Rule0): Rule1[A] = r ~ WS ~ other - def ~~[B](other: Rule1[B]): Rule2[A, B] = r ~ WS ~ other - def ~~[B, C](other: Rule2[B, C]): Rule3[A, B, C] = r ~ WS ~ other - def ~~[B, C, D](other: Rule3[B, C, D]): Rule4[A, B, C, D] = r ~ WS ~ other - def ~~[B, C, D, E](other: Rule4[B, C, D, E]): Rule5[A, B, C, D, E] = r ~ WS ~ other - def ~~[B, C, D, E, F](other: Rule5[B, C, D, E, F]): Rule6[A, B, C, D, E, F] = r ~ WS ~ other - def ~~[B, C, D, E, F, G](other: Rule6[B, C, D, E, F, G]): Rule7[A, B, C, D, E, F, G] = r ~ WS ~ other - - def ~~[B](other: ReductionRule1[A, B]): Rule1[B] = r ~ WS ~ other - - def ~~>>[R](f: (A) => (InputPosition => R)): Rule1[R] = - r ~~> withContext((a: A, ctx) => f(a)(ContextPosition(ctx))) - def ~~>>[Z, R](f: (Z, A) => (InputPosition => R)): ReductionRule1[Z, R] = - r ~~> withContext((z: Z, a: A, ctx) => f(z, a)(ContextPosition(ctx))) - def ~~>>[Y, Z, R](f: (Y, Z, A) => (InputPosition => R)): ReductionRule2[Y, Z, R] = - r ~~> withContext((y: Y, z: Z, a: A, ctx) => f(y, z, a)(ContextPosition(ctx))) - } - - implicit class RichRule2[+A, +B](r: Rule2[A, B]) { - def ~~(other: Rule0): Rule2[A, B] = r ~ WS ~ other - def ~~[C](other: Rule1[C]): Rule3[A, B, C] = r ~ WS ~ other - def ~~[C, D](other: Rule2[C, D]): Rule4[A, B, C, D] = r ~ WS ~ other - def ~~[C, D, E](other: Rule3[C, D, E]): Rule5[A, B, C, D, E] = r ~ WS ~ other - def ~~[C, D, E, F](other: Rule4[C, D, E, F]): Rule6[A, B, C, D, E, F] = r ~ WS ~ other - def ~~[C, D, E, F, G](other: Rule5[C, D, E, F, G]): Rule7[A, B, C, D, E, F, G] = r ~ WS ~ other - - def ~~[BB >: B, C](other: ReductionRule1[BB, C]): Rule2[A, C] = r ~ WS ~ other - def ~~[AA >: A, BB >: B, C](other: ReductionRule2[AA, BB, C]): Rule1[C] = r ~ WS ~ other - - def ~~>>[R](f: (A, B) => InputPosition => R): Rule1[R] = - r ~~> withContext((a: A, b: B, ctx) => f(a, b)(ContextPosition(ctx))) - def ~~>>[Z, R](f: (Z, A, B) => InputPosition => R): ReductionRule1[Z, R] = - r ~~> withContext((z: Z, a: A, b: B, ctx) => f(z, a, b)(ContextPosition(ctx))) - def ~~>>[Y, Z, R](f: (Y, Z, A, B) => InputPosition => R): ReductionRule2[Y, Z, R] = - r ~~> withContext((y: Y, z: Z, a: A, b: B, ctx) => f(y, z, a, b)(ContextPosition(ctx))) - } - - implicit class RichRule3[+A, +B, +C](r: Rule3[A, B, C]) { - def ~~(other: Rule0): Rule3[A, B, C] = r ~ WS ~ other - def ~~[D](other: Rule1[D]): Rule4[A, B, C, D] = r ~ WS ~ other - def ~~[D, E](other: Rule2[D, E]): Rule5[A, B, C, D, E] = r ~ WS ~ other - def ~~[D, E, F](other: Rule3[D, E, F]): Rule6[A, B, C, D, E, F] = r ~ WS ~ other - def ~~[D, E, F, G](other: Rule4[D, E, F, G]): Rule7[A, B, C, D, E, F, G] = r ~ WS ~ other - - def ~~>>[R](f: (A, B, C) => InputPosition => R): Rule1[R] = - r ~~> withContext((a: A, b: B, c: C, ctx) => f(a, b, c)(ContextPosition(ctx))) - } - - implicit class RichRule4[+A, +B, +C, +D](r: Rule4[A, B, C, D]) { - def ~~(other: Rule0): Rule4[A, B, C, D] = r ~ WS ~ other - def ~~[E](other: Rule1[E]): Rule5[A, B, C, D, E] = r ~ WS ~ other - def ~~[E, F](other: Rule2[E, F]): Rule6[A, B, C, D, E, F] = r ~ WS ~ other - def ~~[E, F, G](other: Rule3[E, F, G]): Rule7[A, B, C, D, E, F, G] = r ~ WS ~ other - - def ~~>>[R](f: (A, B, C, D) => InputPosition => R): Rule1[R] = - r ~~> withContext((a: A, b: B, c: C, d: D, ctx) => f(a, b, c, d)(ContextPosition(ctx))) - } - - implicit class RichRule5[+A, +B, +C, +D, +E](r: Rule5[A, B, C, D, E]) { - def ~~(other: Rule0): Rule5[A, B, C, D, E] = r ~ WS ~ other - def ~~[F](other: Rule1[F]): Rule6[A, B, C, D, E, F] = r ~ WS ~ other - def ~~[F, G](other: Rule2[F, G]): Rule7[A, B, C, D, E, F, G] = r ~ WS ~ other - - def ~~>>[R](f: (A, B, C, D, E) => (InputPosition => R)): Rule1[R] = - r ~~> withContext((a: A, b: B, c: C, d: D, e: E, ctx) => f(a, b, c, d, e)(ContextPosition(ctx))) - } - - implicit class RichRule6[+A, +B, +C, +D, +E, +F](r: Rule6[A, B, C, D, E, F]) { - def ~~(other: Rule0): Rule6[A, B, C, D, E, F] = r ~ WS ~ other - def ~~[G](other: Rule1[G]): Rule7[A, B, C, D, E, F, G] = r ~ WS ~ other - - def ~~>>[R](func: (A, B, C, D, E, F) => (InputPosition => R)): Rule1[R] = - r ~~> withContext((a: A, b: B, c: C, d: D, e: E, f: F, ctx) => func(a, b, c, d, e, f)(ContextPosition(ctx))) - } - - implicit class RichRule7[+A, +B, +C, +D, +E, +F, +G](r: Rule7[A, B, C, D, E, F, G]) { - def ~~(other: Rule0): Rule7[A, B, C, D, E, F, G] = r ~ WS ~ other - } - - implicit class RichReductionRule1[-A, +B](r: ReductionRule1[A, B]) { - def ~~(other: Rule0): ReductionRule1[A, B] = r ~ WS ~ other - } - - implicit class RichReductionRule2[-A, -B, +C](r: ReductionRule2[A, B, C]) { - def ~~(other: Rule0): ReductionRule2[A, B, C] = r ~ WS ~ other - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/BufferPosition.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/BufferPosition.scala deleted file mode 100644 index 5e15c334f68d9..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/BufferPosition.scala +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.parboiled.Context -import org.parboiled.buffers.InputBuffer - -object BufferPosition { - def apply(buffer: InputBuffer, offset: Int): InputPosition = { - val position = buffer.getPosition(offset) - InputPosition(offset, position.line, position.column) - } -} - -object ContextPosition { - def apply(ctx: Context[Any]): InputPosition = - BufferPosition(ctx.getInputBuffer, ctx.getMatchRange.start) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Clauses.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Clauses.scala deleted file mode 100644 index 002f3db675ca8..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Clauses.scala +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.frontend.v3_5.ast -import org.neo4j.cypher.internal.frontend.v3_5.ast.{SeekOnly, SeekOrScan} -import org.neo4j.cypher.internal.v3_5.expressions.{Variable, Pattern => ASTPattern} -import org.parboiled.scala._ - -trait Clauses extends Parser - with StartPoints - with Graphs - with Patterns - with Expressions - with Base - with ProcedureCalls { - - def Clause: Rule1[ast.Clause] - - def LoadCSV: Rule1[ast.LoadCSV] = rule("LOAD CSV") { - keyword("LOAD CSV") ~~ - group(keyword("WITH HEADERS") ~ push(true) | push(false)) ~~ - keyword("FROM") ~~ Expression ~~ - keyword("AS") ~~ Variable ~~ - optional(keyword("FIELDTERMINATOR") ~~ StringLiteral) ~~>> - (ast.LoadCSV(_, _, _, _)) - } - - def From: Rule1[ast.With] = rule("FROM") { - keyword("FROM") ~~ SingleGraph ~~>> (ast.From(_)) - } - - def Into: Rule1[ast.With] = rule("INTO") { - keyword("INTO") ~~ SingleGraph ~~>> (ast.Into(_)) - } - - def CreateGraph: Rule1[ast.CreateGraphClause] = - CreateNewSourceGraph | CreateNewTargetGraph | CreateRegularGraph - - private def CreateRegularGraph: Rule1[ast.CreateRegularGraph] = rule("CREATE GRAPH") { - keyword("CREATE") ~~ CreatedGraph ~~>>(t => ast.CreateRegularGraph(t._1, t._2, t._3, t._4)) - } - - private def CreateNewSourceGraph: Rule1[ast.CreateNewSourceGraph] = rule("CREATE GRAPH >>") { - keyword("CREATE") ~~ CreatedGraph ~~ keyword(">>") ~~>>(t => ast.CreateNewSourceGraph(t._1, t._2, t._3, t._4)) - } - - private def CreateNewTargetGraph: Rule1[ast.CreateNewTargetGraph] = rule("CREATE >> GRAPH") { - keyword("CREATE") ~~ keyword(">>") ~~ CreatedGraph ~~>>(t => ast.CreateNewTargetGraph(t._1, t._2, t._3, t._4)) - } - - private def CreatedGraph: Rule1[(Boolean, Variable, Option[ASTPattern], ast.GraphUrl)] = - CreatedGraphAt | CreatedGraphAs - - private def CreatedGraphAt: Rule1[(Boolean, Variable, Option[ASTPattern], ast.GraphUrl)] = - OptSnapshot ~~ keyword("GRAPH") ~~ Variable ~~ optional(keyword("OF") ~~ Pattern) ~~ keyword("AT") ~~ GraphUrl ~~> { - (snapshot, graph, pattern, url) => (snapshot, graph, pattern, url) - } - - private def CreatedGraphAs: Rule1[(Boolean, Variable, Option[ASTPattern], ast.GraphUrl)] = - OptSnapshot ~~ keyword("GRAPH") ~~ optional(keyword("OF") ~~ Pattern) ~~ keyword("AT") ~~ GraphUrl ~~ keyword("AS") ~~ Variable ~~> { - (snapshot, pattern, url, graph) => (snapshot, graph, pattern, url) - } - - private def OptSnapshot: Rule1[Boolean] = rule("[SNAPSHOT]") { - optional(keyword("SNAPSHOT") ~~ push(true)) ~~>(_.getOrElse(false)) - } - - def Persist: Rule1[ast.Persist] = rule("PERSIST") { - keyword("PERSIST") ~~ BoundGraph ~~ keyword("TO") ~~ GraphUrl ~~>>(ast.Persist(_, _)) - } - - def Snapshot: Rule1[ast.Snapshot] = rule("SNAPSHOT") { - keyword("SNAPSHOT") ~~ BoundGraph ~~ keyword("TO") ~~ GraphUrl ~~>>(ast.Snapshot(_, _)) - } - - def Relocate: Rule1[ast.Relocate] = rule("RELOCATE") { - keyword("RELOCATE") ~~ BoundGraph ~~ keyword("TO") ~~ GraphUrl ~~>>(ast.Relocate(_, _)) - } - - def DeleteGraphs: Rule1[ast.DeleteGraphs] = rule("DELETE GRAPHS") { - keyword("DELETE") ~~ ( - (keyword("GRAPHS") ~~ oneOrMore(Variable, separator = CommaSep) ~~>>(ast.DeleteGraphs(_))) - | - (oneOrMore(keyword("GRAPH") ~~ Variable, separator = CommaSep) ~~>>(ast.DeleteGraphs(_))) - ) - } - - def Start: Rule1[ast.Start] = rule("START") { - group( - keyword("START") ~~ oneOrMore(StartPoint, separator = CommaSep) ~~ optional(Where) - ) ~~>> (ast.Start(_, _)) - } - - def Match: Rule1[ast.Match] = rule("MATCH") { - group(( - keyword("OPTIONAL MATCH") ~ push(true) - | keyword("MATCH") ~ push(false) - ) ~~ Pattern ~~ zeroOrMore(Hint, separator = WS) ~~ optional(Where)) ~~>> (ast.Match(_, _, _, _)) - } - - def Merge: Rule1[ast.Merge] = rule("MERGE") { - group( - group(keyword("MERGE") ~~ PatternPart) ~~>> (p => ASTPattern(Seq(p))) ~~ zeroOrMore(MergeAction, - separator = WS) - ) ~~>> (ast.Merge(_, _)) - } - - def Create: Rule1[ast.Clause] = rule("CREATE")( - group(keyword("CREATE UNIQUE") ~~ Pattern) ~~>> (ast.CreateUnique(_)) - | group(keyword("CREATE") ~~ Pattern) ~~>> (ast.Create(_)) - ) - - def SetClause: Rule1[ast.SetClause] = rule("SET") { - group(keyword("SET") ~~ oneOrMore(SetItem, separator = CommaSep)) ~~>> (ast.SetClause(_)) - } - - def Delete: Rule1[ast.Delete] = rule("DELETE")( - group(keyword("DELETE") ~~ oneOrMore(Expression, separator = CommaSep)) ~~>> (ast.Delete(_, forced = false)) - | group(keyword("DETACH DELETE") ~~ oneOrMore(Expression, separator = CommaSep)) ~~>> (ast.Delete(_, forced = true)) - ) - - def Remove: Rule1[ast.Remove] = rule("REMOVE") { - group(keyword("REMOVE") ~~ oneOrMore(RemoveItem, separator = CommaSep)) ~~>> (ast.Remove(_)) - } - - def Foreach: Rule1[ast.Foreach] = rule("FOREACH") { - group( - keyword("FOREACH") ~~ "(" ~~ Variable ~~ keyword("IN") ~~ Expression ~~ "|" ~~ - oneOrMore(Clause, separator = WS) ~~ ")") ~~>> (ast.Foreach(_, _, _)) - } - - def With: Rule1[ast.With] = rule("WITH")( - group(keyword("WITH DISTINCT") ~~ WithBody ~~ optional(Where)) ~~>> (ast.With(distinct = true, _, _, _, _, _, _)) - | group(keyword("WITH") ~~ GraphReturnItems) ~~>> (ast.With(_)) - | group(keyword("WITH") ~~ WithBody ~~ optional(Where)) ~~>> (ast.With(distinct = false, _, _, _, _, _, _)) - ) - - def Unwind: Rule1[ast.Unwind] = rule("UNWIND")( - group(keyword("UNWIND") ~~ Expression ~~ keyword("AS") ~~ Variable) ~~>> (ast.Unwind(_, _)) - ) - - def Return: Rule1[ast.Return] = rule("RETURN")( - group(keyword("RETURN DISTINCT") ~~ ReturnBody) ~~>> (ast.Return(distinct = true, _, _, _, _, _)) - | group(keyword("RETURN") ~~ GraphReturnItems) ~~>> (ast.Return(_)) - | group(keyword("RETURN") ~~ ReturnBody) ~~>> (ast.Return(distinct = false, _, _, _, _, _)) - ) - - def Pragma: Rule1[ast.Clause] = rule("") { - keyword("_PRAGMA") ~~ ( - group( - keyword("WITH NONE") ~ push(ast.ReturnItems(includeExisting = false, Seq())(_)) ~~ optional(Skip) ~~ optional( - Limit) ~~ optional(Where)) ~~>> (ast.With(distinct = false, _, ast.PassAllGraphReturnItems(InputPosition.NONE), None, _, _, _)) - | group(keyword("WITHOUT") ~~ oneOrMore(Variable, separator = CommaSep)) ~~>> (ast.PragmaWithout(_)) - ) - } - - private def Where: Rule1[ast.Where] = rule("WHERE") { - group(keyword("WHERE") ~~ Expression) ~~>> (ast.Where(_)) - } - - def PeriodicCommitHint: Rule1[ast.PeriodicCommitHint] = rule("USING PERIODIC COMMIT")( - group(keyword("USING PERIODIC COMMIT") ~~ optional(SignedIntegerLiteral)) ~~>> (ast.PeriodicCommitHint(_)) - ) - - private def Hint: Rule1[ast.UsingHint] = rule("USING")( - group(keyword("USING INDEX SEEK") ~~ Variable ~~ NodeLabel ~~ "(" ~~ oneOrMore(PropertyKeyName, separator = CommaSep) ~~ ")") ~~>> (ast.UsingIndexHint(_, _, _, SeekOnly)) - | group(keyword("USING INDEX") ~~ Variable ~~ NodeLabel ~~ "(" ~~ oneOrMore(PropertyKeyName, separator = CommaSep) ~~ ")") ~~>> (ast.UsingIndexHint(_, _, _, SeekOrScan)) - | group(keyword("USING JOIN ON") ~~ oneOrMore(Variable, separator = CommaSep)) ~~>> (ast.UsingJoinHint(_)) - | group(keyword("USING SCAN") ~~ Variable ~~ NodeLabel) ~~>> (ast.UsingScanHint(_, _)) - ) - - private def MergeAction = rule("ON")( - group(keyword("ON MATCH") ~~ SetClause) ~~>> (ast.OnMatch(_)) - | group(keyword("ON CREATE") ~~ SetClause) ~~>> (ast.OnCreate(_)) - ) - - private def SetItem: Rule1[ast.SetItem] = rule( - PropertyExpression ~~ group(operator("=") ~~ Expression) ~~>> (ast.SetPropertyItem(_, _)) - | Variable ~~ group(operator("=") ~~ Expression) ~~>> (ast.SetExactPropertiesFromMapItem(_, _)) - | Variable ~~ group(operator("+=") ~~ Expression) ~~>> (ast.SetIncludingPropertiesFromMapItem(_, _)) - | group(Variable ~~ NodeLabels) ~~>> (ast.SetLabelItem(_, _)) - ) - - private def RemoveItem: Rule1[ast.RemoveItem] = rule( - group(Variable ~~ NodeLabels) ~~>> (ast.RemoveLabelItem(_, _)) - | PropertyExpression ~~> ast.RemovePropertyItem - ) - - private def WithBody: Rule5[ast.ReturnItemsDef, ast.GraphReturnItems, Option[ast.OrderBy], Option[ast.Skip], Option[ast.Limit]] = { - ReturnItems ~~ - FakeMandatoryGraphReturnItems ~~ - optional(Order) ~~ - optional(Skip) ~~ - optional(Limit) - } - - private def FakeMandatoryGraphReturnItems: Rule1[ast.GraphReturnItems] = - optional(GraphReturnItems) ~~>> { (optItem) => (pos: InputPosition) => optItem.getOrElse(ast.PassAllGraphReturnItems(pos)) } - - private def ReturnBody: Rule5[ast.ReturnItemsDef, Option[ast.GraphReturnItems], Option[ast.OrderBy], Option[ast.Skip], Option[ast.Limit]] = { - ReturnItems ~~ - optional(GraphReturnItems) ~~ - optional(Order) ~~ - optional(Skip) ~~ - optional(Limit) - } - - private def ReturnItems: Rule1[ast.ReturnItemsDef] = rule("'*', an expression")( - "*" ~ zeroOrMore(CommaSep ~ ReturnItem) ~~>> (ast.ReturnItems(includeExisting = true, _)) - | oneOrMore(ReturnItem, separator = CommaSep) ~~>> (ast.ReturnItems(includeExisting = false, _)) - ) - - private def ReturnItem: Rule1[ast.ReturnItem] = rule( - group(Expression ~~ keyword("AS") ~~ Variable) ~~>> (ast.AliasedReturnItem(_, _)) - | group(Expression ~> (s => s)) ~~>> (ast.UnaliasedReturnItem(_, _)) - ) - - private def Order: Rule1[ast.OrderBy] = rule("ORDER") { - group(keyword("ORDER BY") ~~ oneOrMore(SortItem, separator = CommaSep)) ~~>> (ast.OrderBy(_)) - } - - private def SortItem: Rule1[ast.SortItem] = rule( - group(Expression ~~ (keyword("DESCENDING") | keyword("DESC"))) ~~>> (ast.DescSortItem(_)) - | group(Expression ~~ optional(keyword("ASCENDING") | keyword("ASC"))) ~~>> (ast.AscSortItem(_)) - ) - - private def Skip: Rule1[ast.Skip] = rule("SKIP") { - group(keyword("SKIP") ~~ Expression) ~~>> (ast.Skip(_)) - } - - private def Limit: Rule1[ast.Limit] = rule("LIMIT") { - group(keyword("LIMIT") ~~ Expression) ~~>> (ast.Limit(_)) - } -} - diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Command.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Command.scala deleted file mode 100644 index 1849c83cc11d9..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Command.scala +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.frontend.v3_5.ast -import org.neo4j.cypher.internal.v3_5.{expressions => exp} -import org.parboiled.scala._ - -trait Command extends Parser - with Expressions - with Literals - with Base - with ProcedureCalls { - - def Command: Rule1[ast.Command] = rule( - CreateUniqueConstraint - | CreateUniqueCompositeConstraint - | CreateNodeKeyConstraint - | CreateNodePropertyExistenceConstraint - | CreateRelationshipPropertyExistenceConstraint - | CreateIndex - | DropUniqueConstraint - | DropUniqueCompositeConstraint - | DropNodeKeyConstraint - | DropNodePropertyExistenceConstraint - | DropRelationshipPropertyExistenceConstraint - | DropIndex - ) - - def PropertyExpressions: Rule1[Seq[exp.Property]] = rule("multiple property expressions") { - oneOrMore(WS ~ Variable ~ PropertyLookup, separator = CommaSep) - } - - def CreateIndex: Rule1[ast.CreateIndex] = rule { - group(keyword("CREATE INDEX ON") ~~ NodeLabel ~~ "(" ~~ PropertyKeyNames ~~ ")") ~~>> (ast.CreateIndex(_, _)) - } - - def DropIndex: Rule1[ast.DropIndex] = rule { - group(keyword("DROP INDEX ON") ~~ NodeLabel ~~ "(" ~~ PropertyKeyNames ~~ ")") ~~>> (ast.DropIndex(_, _)) - } - - def CreateUniqueConstraint: Rule1[ast.CreateUniquePropertyConstraint] = rule { - group(keyword("CREATE") ~~ UniqueConstraintSyntax) ~~>> - ((variable, label, property) => ast.CreateUniquePropertyConstraint(variable, label, Seq(property))) - } - - def CreateUniqueCompositeConstraint: Rule1[ast.CreateUniquePropertyConstraint] = rule { - group(keyword("CREATE") ~~ UniqueCompositeConstraintSyntax) ~~>> (ast.CreateUniquePropertyConstraint(_, _, _)) - } - - def CreateNodeKeyConstraint: Rule1[ast.CreateNodeKeyConstraint] = rule { - group(keyword("CREATE") ~~ NodeKeyConstraintSyntax) ~~>> (ast.CreateNodeKeyConstraint(_, _, _)) - } - - def CreateNodePropertyExistenceConstraint: Rule1[ast.CreateNodePropertyExistenceConstraint] = rule { - group(keyword("CREATE") ~~ NodePropertyExistenceConstraintSyntax) ~~>> (ast.CreateNodePropertyExistenceConstraint(_, _, _)) - } - - def CreateRelationshipPropertyExistenceConstraint: Rule1[ast.CreateRelationshipPropertyExistenceConstraint] = rule { - group(keyword("CREATE") ~~ RelationshipPropertyExistenceConstraintSyntax) ~~>> (ast.CreateRelationshipPropertyExistenceConstraint(_, _, _)) - } - - def DropUniqueConstraint: Rule1[ast.DropUniquePropertyConstraint] = rule { - group(keyword("DROP") ~~ UniqueConstraintSyntax) ~~>> - ((variable, label, property) => ast.DropUniquePropertyConstraint(variable, label, Seq(property))) - } - - def DropUniqueCompositeConstraint: Rule1[ast.DropUniquePropertyConstraint] = rule { - group(keyword("DROP") ~~ UniqueCompositeConstraintSyntax) ~~>> (ast.DropUniquePropertyConstraint(_, _, _)) - } - - def DropNodeKeyConstraint: Rule1[ast.DropNodeKeyConstraint] = rule { - group(keyword("DROP") ~~ NodeKeyConstraintSyntax) ~~>> (ast.DropNodeKeyConstraint(_, _, _)) - } - - def DropNodePropertyExistenceConstraint: Rule1[ast.DropNodePropertyExistenceConstraint] = rule { - group(keyword("DROP") ~~ NodePropertyExistenceConstraintSyntax) ~~>> (ast.DropNodePropertyExistenceConstraint(_, _, _)) - } - - def DropRelationshipPropertyExistenceConstraint: Rule1[ast.DropRelationshipPropertyExistenceConstraint] = rule { - group(keyword("DROP") ~~ RelationshipPropertyExistenceConstraintSyntax) ~~>> (ast.DropRelationshipPropertyExistenceConstraint(_, _, _)) - } - - private def ProcedureArguments: Rule1[Option[Seq[exp.Expression]]] = rule("arguments to a procedure") { - optional(group("(" ~~ - zeroOrMore(Expression, separator = CommaSep) ~~ ")" - ) ~~> (_.toIndexedSeq)) - } - - private def NodeKeyConstraintSyntax: Rule3[exp.Variable, exp.LabelName, Seq[exp.Property]] = keyword("CONSTRAINT ON") ~~ "(" ~~ Variable ~~ NodeLabel ~~ ")" ~~ - keyword("ASSERT") ~~ "(" ~~ PropertyExpressions ~~ ")" ~~ keyword("IS NODE KEY") - - private def UniqueConstraintSyntax: Rule3[exp.Variable, exp.LabelName, exp.Property] = keyword("CONSTRAINT ON") ~~ "(" ~~ Variable ~~ NodeLabel ~~ ")" ~~ - keyword("ASSERT") ~~ PropertyExpression ~~ keyword("IS UNIQUE") - - private def UniqueCompositeConstraintSyntax: Rule3[exp.Variable, exp.LabelName, Seq[exp.Property]] = keyword("CONSTRAINT ON") ~~ "(" ~~ Variable ~~ NodeLabel ~~ ")" ~~ - keyword("ASSERT") ~~ "(" ~~ PropertyExpressions ~~ ")" ~~ keyword("IS UNIQUE") - - private def NodePropertyExistenceConstraintSyntax = keyword("CONSTRAINT ON") ~~ "(" ~~ Variable ~~ NodeLabel ~~ ")" ~~ - keyword("ASSERT EXISTS") ~~ "(" ~~ PropertyExpression ~~ ")" - - private def RelationshipPropertyExistenceConstraintSyntax = keyword("CONSTRAINT ON") ~~ RelationshipPatternSyntax ~~ - keyword("ASSERT EXISTS") ~~ "(" ~~ PropertyExpression ~~ ")" - - private def RelationshipPatternSyntax = rule( - ("()-[" ~~ Variable~~ RelType ~~ "]-()") - | ("()-[" ~~ Variable~~ RelType ~~ "]->()") - | ("()<-[" ~~ Variable~~ RelType ~~ "]-()") - ) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/CypherParser.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/CypherParser.scala deleted file mode 100644 index 751db00f48d9a..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/CypherParser.scala +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.util.v3_5.{InputPosition, SyntaxException} -import org.neo4j.cypher.internal.frontend.v3_5.ast -import org.parboiled.scala._ - -class CypherParser extends Parser - with Statement - with Expressions { - - - @throws(classOf[SyntaxException]) - def parse(queryText: String, offset: Option[InputPosition] = None): ast.Statement = - parseOrThrow(queryText, offset, CypherParser.Statements) -} - -object CypherParser extends Parser with Statement with Expressions { - val Statements: Rule1[Seq[ast.Statement]] = rule { - oneOrMore(WS ~ Statement ~ WS, separator = ch(';')) ~~ optional(ch(';')) ~~ EOI.label("end of input") - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Expressions.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Expressions.scala deleted file mode 100644 index 4340fcc35694c..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Expressions.scala +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.v3_5.{expressions => ast} -import org.parboiled.scala._ - -import scala.collection.mutable.ListBuffer - -trait Expressions extends Parser - with Literals - with Patterns - with Base { - - // Precedence loosely based on http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B#Operator_precedence - - def Expression = Expression12 - - private def Expression12: Rule1[ast.Expression] = rule("an expression") { - Expression11 ~ zeroOrMore(WS ~ ( - group(keyword("OR") ~~ Expression11) ~~>> (ast.Or(_: ast.Expression, _)) - ): ReductionRule1[ast.Expression, ast.Expression]) - } - - private def Expression11: Rule1[ast.Expression] = rule("an expression") { - Expression10 ~ zeroOrMore(WS ~ ( - group(keyword("XOR") ~~ Expression10) ~~>> (ast.Xor(_: ast.Expression, _)) - ): ReductionRule1[ast.Expression, ast.Expression]) - } - - private def Expression10: Rule1[ast.Expression] = rule("an expression") { - Expression9 ~ zeroOrMore(WS ~ ( - group(keyword("AND") ~~ Expression9) ~~>> (ast.And(_: ast.Expression, _)) - ): ReductionRule1[ast.Expression, ast.Expression]) - } - - private def Expression9: Rule1[ast.Expression] = rule("an expression") ( - group(keyword("NOT") ~~ Expression9) ~~>> (ast.Not(_)) - | Expression8 - ) - - private def Expression8: Rule1[ast.Expression] = rule("comparison expression") { - val produceComparisons: (ast.Expression, List[PartialComparison]) => InputPosition => ast.Expression = comparisons - Expression7 ~ zeroOrMore(WS ~ PartialComparisonExpression) ~~>> produceComparisons - } - - private case class PartialComparison(op: (ast.Expression, ast.Expression) => (InputPosition) => ast.Expression, - expr: ast.Expression, pos: InputPosition) { - def apply(lhs: ast.Expression) = op(lhs, expr)(pos) - } - - private def PartialComparisonExpression: Rule1[PartialComparison] = ( - group(operator("=") ~~ Expression7) ~~>> { expr: ast.Expression => pos: InputPosition => PartialComparison(eq, expr, pos) } - | group(operator("<>") ~~ Expression7) ~~>> { expr: ast.Expression => pos: InputPosition => PartialComparison(ne, expr, pos) } - | group(operator("!=") ~~ Expression7) ~~>> { expr: ast.Expression => pos: InputPosition => PartialComparison(bne, expr, pos) } - | group(operator("<") ~~ Expression7) ~~>> { expr: ast.Expression => pos: InputPosition => PartialComparison(lt, expr, pos) } - | group(operator(">") ~~ Expression7) ~~>> { expr: ast.Expression => pos: InputPosition => PartialComparison(gt, expr, pos) } - | group(operator("<=") ~~ Expression7) ~~>> { expr: ast.Expression => pos: InputPosition => PartialComparison(lte, expr, pos) } - | group(operator(">=") ~~ Expression7) ~~>> { expr: ast.Expression => pos: InputPosition => PartialComparison(gte, expr, pos) } ) - - private def eq(lhs:ast.Expression, rhs:ast.Expression): InputPosition => ast.Expression = ast.Equals(lhs, rhs) - private def ne(lhs:ast.Expression, rhs:ast.Expression): InputPosition => ast.Expression = ast.NotEquals(lhs, rhs) - private def bne(lhs:ast.Expression, rhs:ast.Expression): InputPosition => ast.Expression = ast.InvalidNotEquals(lhs, rhs) - private def lt(lhs:ast.Expression, rhs:ast.Expression): InputPosition => ast.Expression = ast.LessThan(lhs, rhs) - private def gt(lhs:ast.Expression, rhs:ast.Expression): InputPosition => ast.Expression = ast.GreaterThan(lhs, rhs) - private def lte(lhs:ast.Expression, rhs:ast.Expression): InputPosition => ast.Expression = ast.LessThanOrEqual(lhs, rhs) - private def gte(lhs:ast.Expression, rhs:ast.Expression): InputPosition => ast.Expression = ast.GreaterThanOrEqual(lhs, rhs) - - private def comparisons(first: ast.Expression, rest: List[PartialComparison]): InputPosition => ast.Expression = { - rest match { - case Nil => _ => first - case second :: Nil => _ => second(first) - case more => - var lhs = first - val result = ListBuffer.empty[ast.Expression] - for (rhs <- more) { - result.append(rhs(lhs)) - lhs = rhs.expr - } - ast.Ands(Set(result: _*)) - } - } - - private def Expression7: Rule1[ast.Expression] = rule("an expression") { - Expression6 ~ zeroOrMore(WS ~ ( - group(operator("+") ~~ Expression6) ~~>> (ast.Add(_: ast.Expression, _)) - | group(operator("-") ~~ Expression6) ~~>> (ast.Subtract(_: ast.Expression, _)) - )) - } - - private def Expression6: Rule1[ast.Expression] = rule("an expression") { - Expression5 ~ zeroOrMore(WS ~ ( - group(operator("*") ~~ Expression5) ~~>> (ast.Multiply(_: ast.Expression, _)) - | group(operator("/") ~~ Expression5) ~~>> (ast.Divide(_: ast.Expression, _)) - | group(operator("%") ~~ Expression5) ~~>> (ast.Modulo(_: ast.Expression, _)) - )) - } - - private def Expression5: Rule1[ast.Expression] = rule("an expression") { - Expression4 ~ zeroOrMore(WS ~ ( - group(operator("^") ~~ Expression4) ~~>> (ast.Pow(_: ast.Expression, _)) - )) - } - - private def Expression4: Rule1[ast.Expression] = rule("an expression") ( - Expression3 - | group(operator("+") ~~ Expression4) ~~>> (ast.UnaryAdd(_)) - | group(operator("-") ~~ Expression4) ~~>> (ast.UnarySubtract(_)) - ) - - private def Expression3: Rule1[ast.Expression] = rule("an expression") { - Expression2 ~ zeroOrMore(WS ~ ( - group(operator("=~") ~~ Expression2) ~~>> (ast.RegexMatch(_: ast.Expression, _)) - | group(keyword("IN") ~~ Expression2) ~~>> (ast.In(_: ast.Expression, _)) - | group(keyword("STARTS WITH") ~~ Expression2) ~~>> (ast.StartsWith(_: ast.Expression, _)) - | group(keyword("ENDS WITH") ~~ Expression2) ~~>> (ast.EndsWith(_: ast.Expression, _)) - | group(keyword("CONTAINS") ~~ Expression2) ~~>> (ast.Contains(_: ast.Expression, _)) - | keyword("IS NULL") ~~>> (ast.IsNull(_: ast.Expression)) - | keyword("IS NOT NULL") ~~>> (ast.IsNotNull(_: ast.Expression)) - ): ReductionRule1[ast.Expression, ast.Expression]) - } - - private def Expression2: Rule1[ast.Expression] = rule("an expression") { - Expression1 ~ zeroOrMore(WS ~ ( - PropertyLookup - | NodeLabels ~~>> (ast.HasLabels(_: ast.Expression, _)) - | "[" ~~ Expression ~~ "]" ~~>> (ast.ContainerIndex(_: ast.Expression, _)) - | "[" ~~ optional(Expression) ~~ ".." ~~ optional(Expression) ~~ "]" ~~>> (ast.ListSlice(_: ast.Expression, _, _)) - )) - } - - private def Expression1: Rule1[ast.Expression] = rule("an expression") ( - NumberLiteral - | StringLiteral - | Parameter - | keyword("TRUE") ~ push(ast.True()(_)) - | keyword("FALSE") ~ push(ast.False()(_)) - | keyword("NULL") ~ push(ast.Null()(_)) - | CaseExpression - | group(keyword("COUNT") ~~ "(" ~~ "*" ~~ ")") ~ push(ast.CountStar()(_)) - | MapLiteral - | MapProjection - | ListComprehension - | PatternComprehension - | group("[" ~~ zeroOrMore(Expression, separator = CommaSep) ~~ "]") ~~>> (ast.ListLiteral(_)) - | group(keyword("FILTER") ~~ "(" ~~ FilterExpression ~~ ")") ~~>> (ast.FilterExpression(_, _, _)) - | group(keyword("EXTRACT") ~~ "(" ~~ FilterExpression ~ optional(WS ~ "|" ~~ Expression) ~~ ")") ~~>> (ast.ExtractExpression(_, _, _, _)) - | group(keyword("REDUCE") ~~ "(" ~~ Variable ~~ "=" ~~ Expression ~~ "," ~~ IdInColl ~~ "|" ~~ Expression ~~ ")") ~~>> (ast.ReduceExpression(_, _, _, _, _)) - | group(keyword("ALL") ~~ "(" ~~ FilterExpression ~~ ")") ~~>> (ast.AllIterablePredicate(_, _, _)) - | group(keyword("ANY") ~~ "(" ~~ FilterExpression ~~ ")") ~~>> (ast.AnyIterablePredicate(_, _, _)) - | group(keyword("NONE") ~~ "(" ~~ FilterExpression ~~ ")") ~~>> (ast.NoneIterablePredicate(_, _, _)) - | group(keyword("SINGLE") ~~ "(" ~~ FilterExpression ~~ ")") ~~>> (ast.SingleIterablePredicate(_, _, _)) - | ShortestPathPattern ~~> ast.ShortestPathExpression - | RelationshipsPattern ~~> ast.PatternExpression - | parenthesizedExpression - | FunctionInvocation - | Variable - ) - - def parenthesizedExpression: Rule1[ast.Expression] = "(" ~~ Expression ~~ ")" - - def PropertyExpression: Rule1[ast.Property] = rule { - Expression1 ~ oneOrMore(WS ~ PropertyLookup) - } - - def PropertyLookup: ReductionRule1[ast.Expression, ast.Property] = rule("'.'") { - operator(".") ~~ (PropertyKeyName ~~>> (ast.Property(_: ast.Expression, _))) - } - - private def FilterExpression: Rule3[ast.Variable, ast.Expression, Option[ast.Expression]] = - IdInColl ~ optional(WS ~ keyword("WHERE") ~~ Expression) - - private def IdInColl: Rule2[ast.Variable, ast.Expression] = - Variable ~~ keyword("IN") ~~ Expression - - def FunctionInvocation: Rule1[ast.FunctionInvocation] = rule("a function") { - ((group(Namespace ~~ FunctionName ~~ "(" ~~ - (keyword("DISTINCT") ~ push(true) | EMPTY ~ push(false)) ~~ - zeroOrMore(Expression, separator = CommaSep) ~~ ")" - ) ~~> (_.toIndexedSeq)) memoMismatches) ~~>> (ast.FunctionInvocation(_, _, _, _)) - } - - def ListComprehension: Rule1[ast.ListComprehension] = rule("[") { - group("[" ~~ FilterExpression ~ optional(WS ~ "|" ~~ Expression) ~~ "]") ~~>> (ast.ListComprehension(_, _, _, _)) - } - - def PatternComprehension: Rule1[ast.PatternComprehension] = rule("[") { - group("[" ~~ optional(Variable ~~ operator("=")) ~~ RelationshipsPattern ~ optional(WS ~ keyword("WHERE") ~~ Expression) ~~ "|" ~~ Expression ~~ "]") ~~>> (ast.PatternComprehension(_, _, _, _)) - } - - def CaseExpression: Rule1[ast.CaseExpression] = rule("CASE") { - (group(( - keyword("CASE") ~~ push(None) ~ oneOrMore(WS ~ CaseAlternatives) - | keyword("CASE") ~~ Expression ~~> (Some(_)) ~ oneOrMore(WS ~ CaseAlternatives) - ) ~ optional(WS ~ - keyword("ELSE") ~~ Expression - ) ~~ keyword("END") - ) memoMismatches) ~~>> (ast.CaseExpression(_, _, _)) - } - - private def CaseAlternatives: Rule2[ast.Expression, ast.Expression] = rule("WHEN") { - keyword("WHEN") ~~ Expression ~~ keyword("THEN") ~~ Expression - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Graphs.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Graphs.scala deleted file mode 100644 index 77f918bdfd01c..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Graphs.scala +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.frontend.v3_5.ast -import org.neo4j.cypher.internal.v3_5.{expressions => exp} -import org.parboiled.scala.{Parser, Rule1, Rule2} - -trait Graphs - extends Parser - with Expressions { - - def GraphUrl: Rule1[ast.GraphUrl] = rule("") { - ((Parameter ~~> (Left(_))) | (StringLiteral ~~> (Right(_)))) ~~>> (ast.GraphUrl(_)) - } - - def GraphRef: Rule1[exp.Variable] = !ReservedClauseStartKeyword ~~ Variable - - def GraphRefList: Rule1[List[exp.Variable]] = - oneOrMore(GraphRef, separator = CommaSep) - - private def AsGraph: Rule1[exp.Variable] = - keyword("AS") ~~ GraphRef - - private def GraphAlias: Rule2[exp.Variable, Option[exp.Variable]] = rule(" AS ") { - GraphRef ~~ optional(AsGraph) - } - - private def GraphAs: Rule1[ast.GraphAs] = rule("GRAPH [AS ]") { - keyword("GRAPH") ~~ GraphAlias ~~>> (ast.GraphAs(_, _)) - } - - private def GraphOfAs: Rule1[ast.GraphOfAs] = rule("GRAPH OF [AS ]") { - keyword("GRAPH") ~~ keyword("OF") ~~ Pattern ~~ optional(AsGraph) ~~>> (ast.GraphOfAs(_, _)) - } - - private def GraphAtAs: Rule1[ast.GraphAtAs] = rule("GRAPH AT [AS ]") { - keyword("GRAPH") ~~ keyword("AT") ~~ GraphUrl ~~ optional(AsGraph) ~~>>(ast.GraphAtAs(_, _)) - } - - private def SourceGraphAs: Rule1[ast.SourceGraphAs] = rule("SOURCE GRAPH [AS ]") { - keyword("SOURCE") ~~ keyword("GRAPH") ~~ optional(AsGraph) ~~>> (ast.SourceGraphAs(_)) - } - - private def TargetGraphAs: Rule1[ast.TargetGraphAs] = rule("TARGET GRAPH [AS ]") { - keyword("TARGET") ~~ keyword("GRAPH") ~~ optional(AsGraph) ~~>> (ast.TargetGraphAs(_)) - } - - private def GraphOfShorthand: Rule1[ast.SingleGraphAs] = - keyword("GRAPH") ~~ GraphRef ~~ keyword("OF") ~~ Pattern ~~>> { (ref: exp.Variable, of: exp.Pattern) => ast - .GraphOfAs(of, Some(ref)) } - - private def GraphAtShorthand: Rule1[ast.SingleGraphAs] = - keyword("GRAPH") ~~ GraphRef ~~ keyword("AT") ~~ GraphUrl ~~>> { (ref: exp.Variable, url: ast.GraphUrl) => ast - .GraphAtAs(url, Some(ref)) } - - private def GraphShorthand = GraphOfShorthand | GraphAtShorthand - - def SingleGraph: Rule1[ast.SingleGraphAs] = - SourceGraphAs | TargetGraphAs | GraphAtAs | GraphOfAs | GraphShorthand | GraphAs - - def BoundGraph: Rule1[ast.BoundGraphAs] = - SourceGraphAs | TargetGraphAs | GraphAs - - private def SingleGraphAsList: Rule1[List[ast.SingleGraphAs]] = - oneOrMore(SingleGraph, separator = CommaSep) - - private def ShortGraph: Rule1[ast.SingleGraphAs] = - GraphAlias ~~>> (ast.GraphAs(_, _)) - - private def GraphItem: Rule1[ast.SingleGraphAs] = - SingleGraph | ShortGraph - - // a >> b? - private def ShortNewContextGraphs: Rule1[ast.NewContextGraphs] = - GraphItem ~~ keyword(">>") ~~ optional(GraphItem) ~~>> { (source: ast.SingleGraphAs, target: Option[ast.SingleGraphAs]) => ast.NewContextGraphs(source, target)} - - // >> b - private def ShortNewTargetGraph: Rule1[ast.NewTargetGraph] = - keyword(">>") ~~ GraphItem ~~>> { (target: ast.SingleGraphAs) => ast.NewTargetGraph(target) } - - // a - private def ShortReturnedGraph: Rule1[ast.ReturnedGraph] = - ShortGraph ~~>> { item: ast.SingleGraphAs => ast.ReturnedGraph(item) } - - // GRAPH a >> (GRAPH b)? - private def NewContextGraphs: Rule1[ast.NewContextGraphs] = - SingleGraph ~~ keyword(">>") ~~ optional(GraphItem) ~~>> { (source: ast.SingleGraphAs, target: Option[ast.SingleGraphAs]) => ast.NewContextGraphs(source, target)} - - // >> GRAPH b - private def NewTargetGraph: Rule1[ast.NewTargetGraph] = - keyword(">>") ~~ SingleGraph ~~>> { (target: ast.SingleGraphAs) => ast.NewTargetGraph(target) } - - // GRAPH a - private def ReturnedGraph: Rule1[ast.ReturnedGraph] = - SingleGraph ~~>> { item: ast.SingleGraphAs => ast.ReturnedGraph(item) } - - private def GraphReturnItem: Rule1[ast.GraphReturnItem] = - NewContextGraphs | NewTargetGraph | ReturnedGraph | ShortNewContextGraphs | ShortNewTargetGraph | ShortReturnedGraph - - private def ShortGraphReturnItemList: Rule1[ast.GraphReturnItems] = - keyword("GRAPHS") ~~ oneOrMore( - GraphReturnItem, - separator = CommaSep - ) ~~>> { itemsList: List[ast.GraphReturnItem] => ast.GraphReturnItems(includeExisting = false, itemsList) } - - private def ShortGraphStarReturnItemList: Rule1[ast.GraphReturnItems] = - keyword("GRAPHS") ~~ keyword("*") ~~ optional( - CommaSep ~~ oneOrMore( - GraphReturnItem, - separator = CommaSep - ) ~~>> { itemsList: List[ast.GraphReturnItem] => ast.GraphReturnItems(includeExisting = true, itemsList) } - ) ~~>> { foo: Option[ast.GraphReturnItems] => (pos) => foo.getOrElse(ast.GraphReturnItems(includeExisting = true, List.empty)(pos)) } - - private def GraphReturnItemList: Rule1[ast.GraphReturnItems] = - oneOrMore( - NewContextGraphs | NewTargetGraph | ReturnedGraph , - separator = CommaSep - ) ~~>> { graphReturnItems => ast.GraphReturnItems(includeExisting = false, graphReturnItems) } - - def GraphReturnItems: Rule1[ast.GraphReturnItems] = - ShortGraphStarReturnItemList | ShortGraphReturnItemList | GraphReturnItemList -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/InvalidInputErrorFormatter.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/InvalidInputErrorFormatter.scala deleted file mode 100644 index c5efad3c25150..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/InvalidInputErrorFormatter.scala +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.parboiled.common.StringUtils -import org.parboiled.errors.{DefaultInvalidInputErrorFormatter, InvalidInputError} -import org.parboiled.matchers.{Matcher, TestNotMatcher} -import org.parboiled.support.{Chars, MatcherPath} - -import scala.collection.JavaConversions._ - -class InvalidInputErrorFormatter extends DefaultInvalidInputErrorFormatter { - - override def format(error: InvalidInputError) : String = { - if (error == null) - "" - else { - val len = error.getEndIndex - error.getStartIndex - val sb = new StringBuilder() - if (len > 0) { - val char = error.getInputBuffer.charAt(error.getStartIndex) - if (char == Chars.EOI) { - sb.append("Unexpected end of input") - } else { - sb.append("Invalid input '").append(StringUtils.escape(String.valueOf(char))) - if (len > 1) sb.append("...") - sb.append('\'') - } - } else { - sb.append("Invalid input") - } - val expectedString = getExpectedString(error) - if (StringUtils.isNotEmpty(expectedString)) { - sb.append(": expected ").append(expectedString) - } - sb.toString() - } - } - - override def getExpectedString(error: InvalidInputError) : String = { - val pathStartIndex = error.getStartIndex - error.getIndexDelta - - val labels = error.getFailedMatchers.toList.flatMap(path => { - val labelMatcher = findProperLabelMatcher(path, pathStartIndex) - if (labelMatcher == null) { - List() - } else { - getLabels(labelMatcher).filter(_ != null).flatMap(_.trim match { - case l@"','" => Seq(l) - case "" => Seq() - case l => l.split(",").map(_.trim) - }) - } - }).distinct - - join(labels) - } - - private def findProperLabelMatcher(path: MatcherPath, errorIndex: Int) : Matcher = { - val elements = unfoldRight(path) { p => if (p == null) None else Some(p.element -> p.parent) }.reverse - - val matcher = for (element <- elements.takeWhile(!_.matcher.isInstanceOf[TestNotMatcher]).find(e => { - e.startIndex == errorIndex && e.matcher.hasCustomLabel - })) yield element.matcher - - matcher.orNull - } - - private def unfoldRight[A, B](seed: B)(f: B => Option[(A, B)]): List[A] = f(seed) match { - case Some((a, b)) => a :: unfoldRight(b)(f) - case None => Nil - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/LikePatternParser.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/LikePatternParser.scala deleted file mode 100644 index 3742285fdf9d6..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/LikePatternParser.scala +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.parboiled.scala._ -import org.parboiled.scala.parserunners.ReportingParseRunner - -/** - * Parser that parses a Like pattern into [[ParsedLikePattern]] which contains tokens of [[LikePatternOp]]. - * - * A Like pattern can contain the special characters: - * - * - % wildcard - * - _ matches exactly one character - * - */ -case object LikePatternParser extends Parser { - - def apply(input: String): ParsedLikePattern = - ReportingParseRunner(LikeRule).run(input).result.getOrElse(throw new IllegalArgumentException(s"$input is not valid to use with LIKE")).compact - - /** Base rule */ - def LikeRule: Rule1[ParsedLikePattern] = rule { zeroOrMore(MatchManyRule | MatchSingleRule | MatchTextRule | MatchEscapedCharRule) ~~> ParsedLikePattern ~ EOI } - - def MatchManyRule: Rule1[LikePatternOp] = rule { "%" ~ push(MatchMany) } - - def MatchSingleRule: Rule1[LikePatternOp] = rule { "_" ~ push(MatchSingle) } - - def MatchTextRule: Rule1[LikePatternOp]= oneOrMore(noneOf("%_\\")) ~> MatchText - - def MatchEscapedCharRule: Rule1[LikePatternOp] = rule { "\\" ~ (ANY ~> MatchText) } -} - -/** Contains a sequence of parsed LIKE tokens*/ -case class ParsedLikePattern(ops: List[LikePatternOp]) { - def compact: ParsedLikePattern = { - val newOps = ops.foldLeft(List.empty[LikePatternOp]) { - case (MatchText(fst) :: tl, MatchText(snd)) => - MatchText(fst ++ snd) :: tl - - case (acc, op) => - op :: acc - } - ParsedLikePattern(newOps.reverse) - } - override def toString = ops.mkString("\"","","\"") -} - -sealed trait LikePatternOp - -sealed trait WildcardLikePatternOp extends LikePatternOp - -/** Contains a string that needs quoting for use in regular expression */ -case class MatchText(text: String) extends LikePatternOp { - override def toString = text -} - -/** Matches a % */ -case object MatchMany extends WildcardLikePatternOp { - override def toString = "%" -} - -/** Matches a _*/ -case object MatchSingle extends WildcardLikePatternOp { - override def toString = "_" -} - diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Literals.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Literals.scala deleted file mode 100644 index 7b33653f5abeb..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Literals.scala +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.{expressions => ast} -import org.parboiled.scala._ - -import scala.language.postfixOps - -trait Literals extends Parser - with Base with Strings { - - def Expression: Rule1[ast.Expression] - - def Variable: Rule1[ast.Variable] = - rule("a variable") { SymbolicNameString ~~>> (ast.Variable(_) ) }.memoMismatches - - def ReservedClauseStartKeyword: Rule0 = - keyword("CALL") | - keyword("CREATE") | - keyword("CYPHER") | - keyword("DELETE") | - keyword("DO") | - keyword("DROP") | - keyword("EXPLAIN") | - keyword("FOREACH") | - keyword("FROM") | - keyword("INTO") | - keyword("LOAD") | - keyword("MATCH") | - keyword("MERGE") | - keyword("OPTIONAL") | - keyword("PERSIST") | - keyword("PROFILE") | - keyword("_PRAGMA") | - keyword("RELOCATE") | - keyword("RETURN") | - keyword("SNAPSHOT") | - keyword("START") | - keyword("UNION") | - keyword("USING") | - keyword("UNWIND") | - keyword("WITH") - - def ProcedureName: Rule1[ast.ProcedureName] = - rule("a procedure name") { SymbolicNameString ~~>> (ast.ProcedureName(_) ) }.memoMismatches - - def FunctionName: Rule1[ast.FunctionName] = - rule("a function name") { SymbolicNameString ~~>> (ast.FunctionName(_) ) }.memoMismatches - - def PropertyKeyName: Rule1[ast.PropertyKeyName] = - rule("a property key name") { SymbolicNameString ~~>> (ast.PropertyKeyName(_) ) }.memoMismatches - - def PropertyKeyNames: Rule1[List[ast.PropertyKeyName]] = - rule("a list of property key names") { - (oneOrMore(WS ~~ SymbolicNameString ~~ WS ~~>> (ast.PropertyKeyName(_) ), separator = ",") memoMismatches).suppressSubnodes - } - - def LabelName: Rule1[ast.LabelName] = - rule("a label name") { SymbolicNameString ~~>> (ast.LabelName(_) ) }.memoMismatches - - def RelTypeName: Rule1[ast.RelTypeName] = - rule("a rel type name") { SymbolicNameString ~~>> (ast.RelTypeName(_) ) }.memoMismatches - - def Operator: Rule1[ast.Variable] = rule { - OpChar ~ zeroOrMore(OpCharTail) ~>>> (ast.Variable(_: String)) ~ !OpCharTail - } - - def MapLiteral: Rule1[ast.MapExpression] = rule { - group( - ch('{') ~~ zeroOrMore(PropertyKeyName ~~ ch(':') ~~ Expression, separator = CommaSep) ~~ ch('}') - ) ~~>> (ast.MapExpression(_)) - } - - def LiteralEntry: Rule1[ast.MapProjectionElement] = rule("literal entry")( - PropertyKeyName ~~ ch(':') ~~ Expression ~~>> (ast.LiteralEntry(_, _))) - - def PropertySelector: Rule1[ast.MapProjectionElement] = rule("property selector")( - ch('.') ~~ Variable ~~>> (ast.PropertySelector(_))) - - def VariableSelector: Rule1[ast.MapProjectionElement] = rule("variable selector")( - Variable ~~>> (ast.VariableSelector(_))) - - def AllPropertiesSelector: Rule1[ast.MapProjectionElement] = rule("all properties selector")( - ch('.') ~~ ch('*') ~ push(ast.AllPropertiesSelector()(_))) - - def MapProjection: Rule1[ast.MapProjection] = rule { - group( - Variable ~~ ch('{') ~~ zeroOrMore(LiteralEntry | PropertySelector | VariableSelector | AllPropertiesSelector, CommaSep) ~~ ch('}') - ) ~~>> (ast.MapProjection(_, _)) - } - - def Parameter: Rule1[ast.Parameter] = rule("a parameter") { - NewParameter | OldParameter - } - - def NewParameter: Rule1[ast.Parameter] = rule("a parameter (new syntax") { - ((ch('$') ~~ (UnescapedSymbolicNameString | EscapedSymbolicNameString | UnsignedDecimalInteger ~> (_.toString))) memoMismatches) ~~>> (ast.Parameter(_, CTAny)) - } - - def OldParameter: Rule1[ast.Parameter] = rule("a parameter (old syntax)") { - ((ch('{') ~~ (UnescapedSymbolicNameString | EscapedSymbolicNameString | UnsignedDecimalInteger ~> (_.toString)) ~~ ch('}')) memoMismatches) ~~>> (ast.Parameter(_, CTAny)) - } - - def NumberLiteral: Rule1[ast.Literal] = rule("a number") ( - DoubleLiteral - | SignedIntegerLiteral - ).memoMismatches - - def DoubleLiteral: Rule1[ast.DecimalDoubleLiteral] = rule("a floating point number") ( - ExponentDecimalReal ~>>> (ast.DecimalDoubleLiteral(_)) - | RegularDecimalReal ~>>> (ast.DecimalDoubleLiteral(_)) - ) - - def SignedIntegerLiteral: Rule1[ast.SignedIntegerLiteral] = rule("an integer") ( - HexInteger ~>>> (ast.SignedHexIntegerLiteral(_)) - | OctalInteger ~>>> (ast.SignedOctalIntegerLiteral(_)) - | DecimalInteger ~>>> (ast.SignedDecimalIntegerLiteral(_)) - ) - - def UnsignedIntegerLiteral: Rule1[ast.UnsignedIntegerLiteral] = rule("an unsigned integer") { - UnsignedDecimalInteger ~>>> (ast.UnsignedDecimalIntegerLiteral(_)) - } - - def RangeLiteral: Rule1[ast.Range] = rule ( - group( - optional(UnsignedIntegerLiteral ~ WS) ~ - ".." ~ - optional(WS ~ UnsignedIntegerLiteral) - ) ~~>> (ast.Range(_, _)) - | UnsignedIntegerLiteral ~~>> (l => ast.Range(Some(l), Some(l))) - ) - - def NodeLabels: Rule1[Seq[ast.LabelName]] = rule("node labels") { - (oneOrMore(NodeLabel, separator = WS) memoMismatches).suppressSubnodes - } - - def NodeLabel: Rule1[ast.LabelName] = rule { - ((operator(":") ~~ LabelName) memoMismatches).suppressSubnodes - } - - def RelType: Rule1[ast.RelTypeName] = rule { - ((operator(":") ~~ RelTypeName) memoMismatches).suppressSubnodes - } - - def StringLiteral: Rule1[ast.StringLiteral] = rule("\"...string...\"") { - ((( - ch('\'') ~ StringCharacters('\'') ~ ch('\'') - | ch('"') ~ StringCharacters('"') ~ ch('"') - ) memoMismatches) suppressSubnodes) ~~>> (ast.StringLiteral(_)) - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Patterns.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Patterns.scala deleted file mode 100644 index 847048fc228e3..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Patterns.scala +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -/* - *| NamedPatternPart | - *|Variable | AnonymousPatternPart | - * | PatternElement | - * | PatternElement | RelationshipChain | - * |NodePattern | RelationshipChain ||RelationshipPattern|NodePattern| - * |RelationshipPattern|NodePattern| - * p = shortestPath( (a) -[r1]-> (b) -[r2]-> (c) ) - */ - -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.v3_5.{expressions => ast} -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection -import org.parboiled.scala._ - -trait Patterns extends Parser - with Literals - with Base { - - def Pattern: Rule1[ast.Pattern] = rule("a pattern") { - oneOrMore(PatternPart, separator = CommaSep) ~~>> (ast.Pattern(_)) - } - - def PatternPart: Rule1[ast.PatternPart] = rule("a pattern") ( - group(Variable ~~ operator("=") ~~ AnonymousPatternPart) ~~>> (ast.NamedPatternPart(_, _)) - | AnonymousPatternPart - ) - - private def AnonymousPatternPart: Rule1[ast.AnonymousPatternPart] = rule ( - ShortestPathPattern - | PatternElement ~~> ast.EveryPath - ) - - def ShortestPathPattern: Rule1[ast.ShortestPaths] = rule ( - (group(keyword("shortestPath") ~~ "(" ~~ PatternElement ~~ ")") memoMismatches) ~~>> (ast.ShortestPaths(_, single = true)) - | (group(keyword("allShortestPaths") ~~ "(" ~~ PatternElement ~~ ")") memoMismatches) ~~>> (ast.ShortestPaths(_, single = false)) - ).memoMismatches - - def RelationshipsPattern: Rule1[ast.RelationshipsPattern] = rule { - group(NodePattern ~ oneOrMore(WS ~ PatternElementChain)) ~~>> (ast.RelationshipsPattern(_)) - }.memoMismatches - - private def PatternElement: Rule1[ast.PatternElement] = rule ( - NodePattern ~ zeroOrMore(WS ~ PatternElementChain) - | "(" ~~ PatternElement ~~ ")" - ) - - private def PatternElementChain: ReductionRule1[ast.PatternElement, ast.RelationshipChain] = rule("a relationship pattern") { - group(RelationshipPattern ~~ NodePattern) ~~>> (ast.RelationshipChain(_, _, _)) - } - - private def RelationshipPattern: Rule1[ast.RelationshipPattern] = rule { - ( - LeftArrowHead ~~ Dash ~~ RelationshipDetail ~~ Dash ~~ RightArrowHead ~ push(SemanticDirection.BOTH) - | LeftArrowHead ~~ Dash ~~ RelationshipDetail ~~ Dash ~ push(SemanticDirection.INCOMING) - | Dash ~~ RelationshipDetail ~~ Dash ~~ RightArrowHead ~ push(SemanticDirection.OUTGOING) - | Dash ~~ RelationshipDetail ~~ Dash ~ push(SemanticDirection.BOTH) - ) ~~>> ((variable, relTypes, range, props, dir) => ast.RelationshipPattern(variable, relTypes.types, range, - props, dir, relTypes.legacySeparator)) - } - - private def RelationshipDetail: Rule4[ - Option[ast.Variable], - MaybeLegacyRelTypes, - Option[Option[ast.Range]], - Option[ast.Expression]] = rule("[") { - ( - "[" ~~ - MaybeVariable ~~ - RelationshipTypes ~~ MaybeVariableLength ~ - MaybeProperties ~~ - "]" - | EMPTY ~ push(None) ~ push(MaybeLegacyRelTypes()) ~ push(None) ~ push(None) - ) - } - - private def RelationshipTypes: Rule1[MaybeLegacyRelTypes] = rule("relationship types") ( - (":" ~~ RelTypeName ~~ zeroOrMore(WS ~ "|" ~~ LegacyCompatibleRelTypeName)) ~~>> ( - (first: ast.RelTypeName, more: List[(Boolean, ast.RelTypeName)]) => (pos: InputPosition) => { - MaybeLegacyRelTypes(first +: more.map(_._2), more.exists(_._1)) - }) - | EMPTY ~ push(MaybeLegacyRelTypes()) - ) - - private def LegacyCompatibleRelTypeName: Rule1[(Boolean, ast.RelTypeName)] = - ((":" ~ push(true)) | EMPTY ~ push(false)) ~~ RelTypeName ~~>> ( - (legacy: Boolean, name: ast.RelTypeName) => (pos: InputPosition) => (legacy,name)) - - private def MaybeVariableLength: Rule1[Option[Option[ast.Range]]] = rule("a length specification") ( - "*" ~~ ( - RangeLiteral ~~> (r => Some(Some(r))) - | EMPTY ~ push(Some(None)) - ) - | EMPTY ~ push(None) - ) - - private def NodePattern: Rule1[ast.NodePattern] = rule("a node pattern") ( - group("(" ~~ MaybeVariable ~ MaybeNodeLabels ~ MaybeProperties ~~ ")") ~~>> (ast.NodePattern(_, _, _)) - | group(Variable ~ MaybeNodeLabels ~ MaybeProperties) ~~>> (ast.InvalidNodePattern(_, _, _)) // Here to give nice error messages - ) - - private def MaybeVariable: Rule1[Option[ast.Variable]] = rule("a variable") { - optional(Variable) - } - - private def MaybeNodeLabels: Rule1[Seq[ast.LabelName]] = rule("node labels") ( - WS ~ NodeLabels | EMPTY ~ push(Seq()) - ) - - private def MaybeProperties: Rule1[Option[ast.Expression]] = rule("a property map") ( - optional(WS ~ (MapLiteral | Parameter)) - ) -} - -case class MaybeLegacyRelTypes(types: Seq[ast.RelTypeName] = Seq.empty, legacySeparator: Boolean = false) diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ProcedureCalls.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ProcedureCalls.scala deleted file mode 100644 index 8d03318d77de3..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ProcedureCalls.scala +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.frontend.v3_5.ast -import org.neo4j.cypher.internal.v3_5.{expressions => exp} -import org.parboiled.scala._ - -trait ProcedureCalls { - self: Parser with Base with Expressions with Literals => - - def Call: Rule1[ast.UnresolvedCall] = rule("CALL") { - group(keyword("CALL") ~~ Namespace ~ ProcedureName ~ ProcedureArguments ~~ ProcedureResult) ~~>> (ast.UnresolvedCall(_, _, _, _)) - } - - private def ProcedureArguments: Rule1[Option[Seq[exp.Expression]]] = rule("arguments to a procedure") { - optional(group("(" ~~ - zeroOrMore(Expression, separator = CommaSep) ~~ ")" - ) ~~> (_.toIndexedSeq)) - } - - private def ProcedureResult = - rule("result fields of a procedure") { - optional( - group( - keyword("YIELD") ~~ - oneOrMore(ProcedureResultItem, separator = CommaSep) ~~ - optional(group(keyword("WHERE") ~~ Expression ~~>> (ast.Where(_)))) - ) ~~> { (a, b) => a -> b } ~~>> (procedureResult(_)) - ) - } - - private def procedureResult(data: (List[ast.ProcedureResultItem], Option[ast.Where]))(pos: InputPosition) = { - val (items, optWhere) = data - ast.ProcedureResult(items.toIndexedSeq, optWhere)(pos) - } - - private def ProcedureResultItem: Rule1[ast.ProcedureResultItem] = - AliasedProcedureResultItem | SimpleProcedureResultItem - - private def AliasedProcedureResultItem: Rule1[ast.ProcedureResultItem] = - rule("aliased procedure result field") { - ProcedureOutput ~~ keyword("AS") ~~ Variable ~~>> (ast.ProcedureResultItem(_, _)) - } - - private def SimpleProcedureResultItem: Rule1[ast.ProcedureResultItem] = - rule("simple procedure result field") { - Variable ~~>> (ast.ProcedureResultItem(_)) - } - - private def ProcedureOutput: Rule1[exp.ProcedureOutput] = - rule("procedure output") { - SymbolicNameString ~~>> (exp.ProcedureOutput(_)) - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Query.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Query.scala deleted file mode 100644 index 0bbb24ea65bb3..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Query.scala +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.frontend.v3_5.ast -import org.parboiled.scala._ - -trait Query extends Parser - with Clauses - with Base { - - def Query: Rule1[ast.Query] = ( - RegularQuery - | BulkImportQuery - ) - - def RegularQuery: Rule1[ast.Query] = rule { - SingleQuery ~ zeroOrMore(WS ~ Union) ~~>> (ast.Query(None, _)) - } - - def SingleQuery: Rule1[ast.SingleQuery] = rule { - oneOrMore(Clause, separator = WS) ~~>> (ast.SingleQuery(_)) - } - - def BulkImportQuery: Rule1[ast.Query] = rule { - group(PeriodicCommitHint ~ WS ~ LoadCSVQuery) ~~>> ((hint, query) => ast.Query(Some(hint), query)) - } - - def LoadCSVQuery: Rule1[ast.SingleQuery] = rule { - LoadCSV ~ WS ~ zeroOrMore(Clause, separator = WS) ~~>> ((loadCSV, tail) => ast.SingleQuery(Seq(loadCSV) ++ tail)) - } - - def Clause: Rule1[ast.Clause] = ( - LoadCSV - | From - | Into - | Start - | Match - | Unwind - | Merge - | CreateGraph - | Create - | SetClause - | DeleteGraphs - | Delete - | Remove - | Foreach - | With - | Call - | Persist - | Relocate - | Return - | Snapshot - | Pragma - ) - - def Union: ReductionRule1[ast.QueryPart, ast.QueryPart] = rule("UNION") ( - keyword("UNION ALL") ~>> position ~~ SingleQuery ~~> ((q: ast.QueryPart, p, sq) => ast.UnionAll(q, sq)(p)) - | keyword("UNION") ~>> position ~~ SingleQuery ~~> ((q: ast.QueryPart, p, sq) => ast.UnionDistinct(q, sq)(p)) - ) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/StartPoints.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/StartPoints.scala deleted file mode 100644 index fa439910bc56d..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/StartPoints.scala +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.frontend.v3_5.ast -import org.neo4j.cypher.internal.v3_5.{expressions => exp} -import org.parboiled.scala._ - -trait StartPoints extends Parser - with Literals - with Base { - - def StartPoint: Rule1[ast.StartItem] = rule { - Variable ~>> position ~~ operator("=") ~~ Lookup - } - - private def Lookup: ReductionRule2[exp.Variable, InputPosition, ast.StartItem] = { - NodeLookup | RelationshipLookup - } - - private def NodeLookup: ReductionRule2[exp.Variable, InputPosition, ast.StartItem] = { - keyword("NODE") ~~ (NodeIndexLookup | NodeIndexQuery | NodeIdLookup) - } - - private def NodeIdLookup: ReductionRule2[exp.Variable, InputPosition, ast.StartItem] = rule { - "(" ~~ ( - LiteralIds ~~> ((i: exp.Variable, p: InputPosition, ids) => ast.NodeByIds(i, ids)(p)) - | Parameter ~~> ((i: exp.Variable, p: InputPosition, param) => ast.NodeByParameter(i, param)(p)) - | "*" ~~> ((i: exp.Variable, p: InputPosition) => ast.AllNodes(i)(p)) - ) ~~ ")" - } - - private def NodeIndexLookup: ReductionRule2[exp.Variable, InputPosition, ast.NodeByIdentifiedIndex] = { - IdentifiedIndexLookup ~~> ((i, p, index, key, value) => ast.NodeByIdentifiedIndex(i, index, key, value)(p)) - } - - private def NodeIndexQuery: ReductionRule2[exp.Variable, InputPosition, ast.NodeByIndexQuery] = rule { - IndexQuery ~~> ((i: exp.Variable, p: InputPosition, index, query) => ast.NodeByIndexQuery(i, index, query)(p)) - } - - private def RelationshipLookup: ReductionRule2[exp.Variable, InputPosition, ast.StartItem] = { - (keyword("RELATIONSHIP") | keyword("REL")).label("RELATIONSHIP") ~~ (RelationshipIndexLookup | RelationshipIndexQuery | RelationshipIdLookup) - } - - private def RelationshipIdLookup: ReductionRule2[exp.Variable, InputPosition, ast.StartItem] = rule { - "(" ~~ ( - LiteralIds ~~> ((i: exp.Variable, p: InputPosition, ids) => ast.RelationshipByIds(i, ids)(p)) - | Parameter ~~> ((i: exp.Variable, p: InputPosition, param) => ast.RelationshipByParameter(i, param)(p)) - | "*" ~~> ((i: exp.Variable, p: InputPosition) => ast.AllRelationships(i)(p)) - ) ~~ ")" - } - - private def RelationshipIndexLookup: ReductionRule2[exp.Variable, InputPosition, ast.RelationshipByIdentifiedIndex] - = { - IdentifiedIndexLookup ~~> ((i, p, index, key, value) => ast.RelationshipByIdentifiedIndex(i, index, key, value)(p)) - } - - private def RelationshipIndexQuery: ReductionRule2[exp.Variable, InputPosition, ast.RelationshipByIndexQuery] = rule { - IndexQuery ~~> ((i: exp.Variable, p: InputPosition, index, query) => ast.RelationshipByIndexQuery(i, index, query) - (p)) - } - - private def IdentifiedIndexLookup: Rule3[String, String, exp.Expression] = rule { - ":" ~~ SymbolicNameString ~~ "(" ~~ SymbolicNameString ~~ operator("=") ~~ (StringLiteral | Parameter) ~~ ")" - } - - private def IndexQuery: Rule2[String, exp.Expression] = rule { - ":" ~~ SymbolicNameString ~~ "(" ~~ (StringLiteral | Parameter) ~~ ")" - } - - private def LiteralIds: Rule1[Seq[exp.UnsignedIntegerLiteral]] = rule("an unsigned integer") { - oneOrMore(UnsignedIntegerLiteral, separator = CommaSep) - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Statement.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Statement.scala deleted file mode 100644 index a631db3c67e02..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Statement.scala +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.frontend.v3_5.ast -import org.parboiled.scala._ - -trait Statement extends Parser - with Query - with Command - with Base { - - def Statement: Rule1[ast.Statement] = rule ( - Command - | Query - ) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Strings.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Strings.scala deleted file mode 100644 index 383f9412af330..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/Strings.scala +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.parboiled.Context -import org.parboiled.scala._ - -trait Strings extends Base { - - protected def StringCharacters(c: Char): Rule1[String] = { - push(new java.lang.StringBuilder) ~ zeroOrMore(EscapedChar | NormalChar(c)) ~~> (_.toString()) - } - - protected def NormalChar(c: Char) = { - !(ch('\\') | ch(c)) ~ ANY ~:% withContext(appendToStringBuilder(_)(_)) - } - - protected def EscapedChar = { - "\\" ~ ( - ch('\\') ~:% withContext(appendToStringBuilder(_)(_)) - | ch('\'') ~:% withContext(appendToStringBuilder(_)(_)) - | ch('"') ~:% withContext(appendToStringBuilder(_)(_)) - | ch('b') ~ appendToStringBuilder('\b') - | ch('f') ~ appendToStringBuilder('\f') - | ch('n') ~ appendToStringBuilder('\n') - | ch('r') ~ appendToStringBuilder('\r') - | ch('t') ~ appendToStringBuilder('\t') - | UTF16 ~~% withContext((code, ctx) => appendCodePointToStringBuilder(code)(ctx)) - | UTF32 ~~% withContext((code, ctx) => appendCodePointToStringBuilder(code)(ctx)) - ) - } - - protected def UTF16 = rule { ch('u') ~ group(HexDigit ~ HexDigit ~ HexDigit ~ HexDigit) ~> (java.lang.Integer.parseInt(_, 16)) } - protected def UTF32 = rule { ch('U') ~ group(HexDigit ~ HexDigit ~ HexDigit ~ HexDigit ~ HexDigit ~ HexDigit ~ HexDigit ~ HexDigit) ~> (java.lang.Integer.parseInt(_, 16)) } - private def HexDigit = rule ("four hexadecimal digits specifying a unicode character") { "0" - "9" | "a" - "f" | "A" - "F" } - - protected def appendToStringBuilder(c: Any): Context[Any] => Unit = ctx => - ctx.getValueStack.peek.asInstanceOf[java.lang.StringBuilder].append(c) - () - - protected def appendCodePointToStringBuilder(codePoint: java.lang.Integer): Context[Any] => Unit = ctx => - ctx.getValueStack.peek.asInstanceOf[java.lang.StringBuilder].appendCodePoint(codePoint) - () -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/convertLikePatternToRegex.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/convertLikePatternToRegex.scala deleted file mode 100644 index 3a4b87d9c6c18..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/convertLikePatternToRegex.scala +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import java.util.regex.Pattern._ - -/** - * Converts [[ParsedLikePattern]] into a regular expression string - */ -case object convertLikePatternToRegex { - def apply(in: ParsedLikePattern, caseInsensitive: Boolean = false): String = - in.ops.map(convert).mkString(if (caseInsensitive) "(?i)" else "", "", "") - - private def convert(in: LikePatternOp): String = in match { - case MatchText(s) => quote(s) - case MatchMany => ".*" - case MatchSingle => "." - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/matchers/IdentifierPartMatcher.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/matchers/IdentifierPartMatcher.scala deleted file mode 100644 index 777f915060b57..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/matchers/IdentifierPartMatcher.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser.matchers - -class IdentifierPartMatcher extends ScalaCharMatcher("an identifier character") { - protected def matchChar(c: Char): Boolean = Character.isJavaIdentifierPart(c) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/matchers/IdentifierStartMatcher.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/matchers/IdentifierStartMatcher.scala deleted file mode 100644 index eb60fd3c694cf..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/matchers/IdentifierStartMatcher.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser.matchers - -class IdentifierStartMatcher extends ScalaCharMatcher("an identifier") { - protected def matchChar(c: Char): Boolean = Character.isJavaIdentifierStart(c) && Character.getType(c) != Character.CURRENCY_SYMBOL -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/matchers/ScalaCharMatcher.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/matchers/ScalaCharMatcher.scala deleted file mode 100644 index 21dccefddc567..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/matchers/ScalaCharMatcher.scala +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser.matchers - -import org.parboiled.MatcherContext -import org.parboiled.matchers.CustomMatcher - -abstract class ScalaCharMatcher(label: String) extends CustomMatcher(label) { - - protected def matchChar(c: Char): Boolean - - def `match`[V](context: MatcherContext[V]): Boolean = - if (matchChar(context.getCurrentChar)) { - context.advanceIndex(1) - context.createNode() - true - } else { - false - } - - def isSingleCharMatcher: Boolean = true - - def canMatchEmpty: Boolean = false - - def isStarterChar(c: Char): Boolean = matchChar(c) - - def getStarterChar: Char = 'a' -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/matchers/WhitespaceCharMatcher.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/matchers/WhitespaceCharMatcher.scala deleted file mode 100644 index 31a1c610003ae..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/matchers/WhitespaceCharMatcher.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser.matchers - -class WhitespaceCharMatcher extends ScalaCharMatcher("whitespace") { - protected def matchChar(c: Char): Boolean = c.isWhitespace -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/package.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/package.scala deleted file mode 100644 index b075f7be5773e..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/package.scala +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5 - -import org.neo4j.cypher.internal.frontend.v3_5.parser.matchers._ -import org.parboiled.scala._ - -package object parser { - lazy val IdentifierStart: Rule0 = new IdentifierStartMatcher() - lazy val IdentifierPart: Rule0 = new IdentifierPartMatcher() - lazy val WSChar: Rule0 = new WhitespaceCharMatcher() -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/AstRewriting.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/AstRewriting.scala deleted file mode 100644 index 200720f1f18b1..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/AstRewriting.scala +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.phases - -import org.neo4j.cypher.internal.frontend.v3_5.ast.conditions._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.{ASTRewriter, LiteralExtraction} -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.RewriterStepSequencer -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.AST_REWRITE -import org.neo4j.cypher.internal.v3_5.expressions.NotEquals - -case class AstRewriting(sequencer: String => RewriterStepSequencer, literalExtraction: LiteralExtraction, - getDegreeRewriting: Boolean = true// This does not really belong in the front end. Should move to a planner rewriter -) extends Phase[BaseContext, BaseState, BaseState] { - - private val astRewriter = new ASTRewriter(sequencer, literalExtraction, getDegreeRewriting) - - override def process(in: BaseState, context: BaseContext): BaseState = { - - val (rewrittenStatement, extractedParams, _) = astRewriter.rewrite(in.queryText, in.statement(), in.semantics()) - - in.withStatement(rewrittenStatement).withParams(extractedParams) - } - - override def phase = AST_REWRITE - - override def description = "normalize the AST into a form easier for the planner to work with" - - override def postConditions: Set[Condition] = { - val rewriterConditions = Set( - noReferenceEqualityAmongVariables, - orderByOnlyOnVariables, - noDuplicatesInReturnItems, - containsNoReturnAll, - noUnnamedPatternElementsInMatch, - containsNoNodesOfType[NotEquals], - normalizedEqualsArguments, - aggregationsAreIsolated, - noUnnamedPatternElementsInPatternComprehension - ) - - rewriterConditions.map(StatementCondition.apply) - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/BaseContext.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/BaseContext.scala deleted file mode 100644 index ca90c8bd07e90..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/BaseContext.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.phases - -import org.neo4j.cypher.internal.util.v3_5.{CypherException, InputPosition} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticErrorDef - -trait BaseContext { - def tracer: CompilationPhaseTracer - def notificationLogger: InternalNotificationLogger - def exceptionCreator: (String, InputPosition) => CypherException - def monitors: Monitors - def errorHandler: (Seq[SemanticErrorDef] => Unit) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/BaseState.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/BaseState.scala deleted file mode 100644 index 6495536cfb372..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/BaseState.scala +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.phases - -import org.neo4j.cypher.internal.util.v3_5.{InputPosition, InternalException} -import org.neo4j.cypher.internal.frontend.v3_5.ast.{Query, Statement} -import org.neo4j.cypher.internal.frontend.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticState, SemanticTable} -import org.neo4j.cypher.internal.util.v3_5.symbols.CypherType - -trait BaseState { - def queryText: String - def startPosition: Option[InputPosition] - def plannerName: PlannerName - def initialFields: Map[String, CypherType] - def maybeStatement: Option[Statement] - def maybeSemantics: Option[SemanticState] - def maybeExtractedParams: Option[Map[String, Any]] - def maybeSemanticTable: Option[SemanticTable] - - def accumulatedConditions: Set[Condition] - - def isPeriodicCommit: Boolean = statement() match { - case Query(Some(_), _) => true - case _ => false - } - - def statement(): Statement = maybeStatement getOrElse fail("Statement") - def semantics(): SemanticState = maybeSemantics getOrElse fail("Semantics") - def extractedParams(): Map[String, Any] = maybeExtractedParams getOrElse fail("Extracted parameters") - def semanticTable(): SemanticTable = maybeSemanticTable getOrElse fail("Semantic table") - - protected def fail(what: String) = { - throw new InternalException(s"$what not yet initialised") - } - - def withStatement(s: Statement): BaseState - def withSemanticTable(s: SemanticTable): BaseState - def withSemanticState(s: SemanticState): BaseState - def withParams(p: Map[String, Any]): BaseState -} - -case class InitialState(queryText: String, - startPosition: Option[InputPosition], - plannerName: PlannerName, - initialFields: Map[String, CypherType] = Map.empty, - maybeStatement: Option[Statement] = None, - maybeSemantics: Option[SemanticState] = None, - maybeExtractedParams: Option[Map[String, Any]] = None, - maybeSemanticTable: Option[SemanticTable] = None, - accumulatedConditions: Set[Condition] = Set.empty) extends BaseState { - - override def withStatement(s: Statement): InitialState = copy(maybeStatement = Some(s)) - - override def withSemanticTable(s: SemanticTable): InitialState = copy(maybeSemanticTable = Some(s)) - - override def withSemanticState(s: SemanticState): InitialState = copy(maybeSemantics = Some(s)) - - override def withParams(p: Map[String, Any]): InitialState = copy(maybeExtractedParams = Some(p)) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/CompilationPhases.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/CompilationPhases.scala deleted file mode 100644 index a8b2a6380ec03..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/CompilationPhases.scala +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.phases - -import org.neo4j.cypher.internal.frontend.v3_5.ast.Statement -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters._ -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.RewriterStepSequencer -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticState - -object CompilationPhases { - - def parsing(sequencer: String => RewriterStepSequencer, literalExtraction: LiteralExtraction = IfNoParameter): Transformer[BaseContext, BaseState, BaseState] = - Parsing.adds(BaseContains[Statement]) andThen - SyntaxDeprecationWarnings andThen - PreparatoryRewriting andThen - SemanticAnalysis(warn = true).adds(BaseContains[SemanticState]) andThen - AstRewriting(sequencer, literalExtraction) - - def lateAstRewriting: Transformer[BaseContext, BaseState, BaseState] = - SemanticAnalysis(warn = false) andThen - Namespacer andThen - transitiveClosure andThen - rewriteEqualityToInPredicate andThen - CNFNormalizer andThen - LateAstRewriting -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/Condition.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/Condition.scala deleted file mode 100644 index c8fd22a3b6166..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/Condition.scala +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.phases - -import org.neo4j.cypher.internal.frontend.v3_5.ast.Statement -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticState - -import scala.reflect.ClassTag - -trait Condition { - def check(state: AnyRef): Seq[String] -} - -case class BaseContains[T: ClassTag](implicit manifest: Manifest[T]) extends Condition { - private val acceptableTypes: Set[Class[_]] = Set( - classOf[Statement], - classOf[SemanticState] - ) - - assert(acceptableTypes.contains(manifest.runtimeClass)) - - override def check(in: AnyRef): Seq[String] = in match { - case state: BaseState => - manifest.runtimeClass match { - case x if classOf[Statement] == x && state.maybeStatement.isEmpty => Seq("Statement missing") - case x if classOf[SemanticState] == x && state.maybeSemantics.isEmpty => Seq("Semantic State missing") - case _ => Seq.empty - } - case x => throw new IllegalArgumentException(s"Unknown state: $x") - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/InternalNotificationLogger.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/InternalNotificationLogger.scala deleted file mode 100644 index 8d76c16bdb589..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/InternalNotificationLogger.scala +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.phases - -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.frontend.v3_5.notification.InternalNotification - -/** - * A NotificationLogger records notifications. - */ -sealed trait InternalNotificationLogger { - def offset: Option[InputPosition] = None - - def log(notification: InternalNotification) - - def notifications: Set[InternalNotification] -} - -/** - * A null implementation that discards all notifications. - */ -case object devNullLogger extends InternalNotificationLogger { - override def log(notification: InternalNotification) {} - - override def notifications: Set[InternalNotification] = Set.empty -} - -/** - * NotificationLogger that records all notifications for later retrieval. - */ -class RecordingNotificationLogger(override val offset: Option[InputPosition] = None) extends InternalNotificationLogger { - private val builder = Set.newBuilder[InternalNotification] - - def log(notification: InternalNotification) = builder += notification - - def notifications = builder.result() -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/LateAstRewriting.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/LateAstRewriting.scala deleted file mode 100644 index 888c6eca374c8..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/LateAstRewriting.scala +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.phases - -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, inSequence} -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters._ - -object LateAstRewriting extends StatementRewriter { - override def instance(context: BaseContext): Rewriter = inSequence( - collapseMultipleInPredicates, - nameUpdatingClauses, - projectNamedPaths, -// enableCondition(containsNamedPathOnlyForShortestPath), // TODO Re-enable - projectFreshSortExpressions - ) - - override def description: String = "normalize the AST" - - override def postConditions: Set[Condition] = Set.empty -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/Monitors.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/Monitors.scala deleted file mode 100644 index a652ccb203e96..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/Monitors.scala +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.phases - -import scala.reflect.ClassTag - -trait Monitors { - def addMonitorListener[T](monitor: T, tags: String*) - def newMonitor[T <: AnyRef : ClassTag](tags: String*): T -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/Parsing.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/Parsing.scala deleted file mode 100644 index 77838f6f56d60..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/Parsing.scala +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.phases - -import org.neo4j.cypher.internal.frontend.v3_5.ast.Statement -import org.neo4j.cypher.internal.frontend.v3_5.parser.CypherParser -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.PARSING - -case object Parsing extends Phase[BaseContext, BaseState, BaseState] { - private val parser = new CypherParser - - override def process(in: BaseState, ignored: BaseContext): BaseState = - in.withStatement(parser.parse(in.queryText, in.startPosition)) - - override val phase = PARSING - - override val description = "parse text into an AST object" - - override def postConditions = Set(BaseContains[Statement]) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/Phase.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/Phase.scala deleted file mode 100644 index 8490f0970a380..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/Phase.scala +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.phases - -import org.neo4j.cypher.internal.frontend.v3_5.helpers.closing -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.PIPE_BUILDING - -/* -A phase is a leaf component of the tree structure that is the compilation pipe line. -It passes through the compilation state, and might add values to it - */ -trait Phase[-C <: BaseContext, FROM, TO] extends Transformer[C, FROM, TO] { - self => - - def phase: CompilationPhase - - def description: String - - override def transform(from: FROM, context: C): TO = - closing(context.tracer.beginPhase(phase)) { - process(from, context) - } - - def process(from: FROM, context: C): TO - - def postConditions: Set[Condition] - - def name = getClass.getSimpleName -} - -/* -A visitor is a phase that does not change the compilation state. All it's behaviour is side effects - */ -trait VisitorPhase[-C <: BaseContext, STATE] extends Phase[C, STATE, STATE] { - override def process(from: STATE, context: C): STATE = { - visit(from, context) - from - } - - def visit(value: STATE, context: C): Unit - - override def postConditions = Set.empty -} - -case class AddCondition[-C <: BaseContext, STATE](postCondition: Condition) extends Phase[C, STATE, STATE] { - override def phase: CompilationPhase = PIPE_BUILDING - - override def description: String = "adds a condition" - - override def process(from: STATE, context: C): STATE = from - - override def postConditions = Set(postCondition) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/PreparatoryRewriting.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/PreparatoryRewriting.scala deleted file mode 100644 index bd79098a69c81..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/PreparatoryRewriting.scala +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.phases - -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters._ -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.AST_REWRITE -import org.neo4j.cypher.internal.util.v3_5.inSequence - -case object PreparatoryRewriting extends Phase[BaseContext, BaseState, BaseState] { - - override def process(from: BaseState, context: BaseContext): BaseState = { - - val rewrittenStatement = from.statement().endoRewrite(inSequence( - createGraphIntroducesHorizon, - normalizeGraphReturnItems, - normalizeReturnClauses(context.exceptionCreator), - normalizeWithClauses(context.exceptionCreator), - expandCallWhere, - replaceAliasedFunctionInvocations, - mergeInPredicates)) - - from.withStatement(rewrittenStatement) - } - - override val phase = AST_REWRITE - - override val description = "rewrite the AST into a shape that semantic analysis can be performed on" - - override def postConditions = Set.empty -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/SemanticAnalysis.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/SemanticAnalysis.scala deleted file mode 100644 index 4f9beeb9497f9..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/SemanticAnalysis.scala +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.phases - -import org.neo4j.cypher.internal.frontend.v3_5.ast.UnaliasedReturnItem -import org.neo4j.cypher.internal.frontend.v3_5.ast.conditions.{StatementCondition, containsNoNodesOfType} -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.SEMANTIC_CHECK -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticCheckResult, SemanticChecker, SemanticFeature, SemanticState} - -case class SemanticAnalysis(warn: Boolean, features: SemanticFeature*) - extends Phase[BaseContext, BaseState, BaseState] { - - override def process(from: BaseState, context: BaseContext): BaseState = { - val startState = { - if (from.initialFields.nonEmpty) - SemanticState.withStartingVariables(from.initialFields.toSeq: _*) - else - SemanticState.clean - }.withFeatures(features: _*) - - val SemanticCheckResult(state, errors) = SemanticChecker.check(from.statement(), startState) - if (warn) state.notifications.foreach(context.notificationLogger.log) - - context.errorHandler(errors) - - from.withSemanticState(state) - } - - override def phase: CompilationPhaseTracer.CompilationPhase = SEMANTIC_CHECK - - override def description = "do variable binding, typing, type checking and other semantic checks" - - override def postConditions = Set(BaseContains[SemanticState], StatementCondition(containsNoNodesOfType[UnaliasedReturnItem])) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/SyntaxDeprecationWarnings.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/SyntaxDeprecationWarnings.scala deleted file mode 100644 index 33ef0f7e328e5..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/SyntaxDeprecationWarnings.scala +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.phases - -import org.neo4j.cypher.internal.frontend.v3_5.ast.Statement -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.replaceAliasedFunctionInvocations.aliases -import org.neo4j.cypher.internal.frontend.v3_5.notification.{DeprecatedFunctionNotification, DeprecatedRelTypeSeparatorNotification, DeprecatedVarLengthBindingNotification, InternalNotification} -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.DEPRECATION_WARNINGS -import org.neo4j.cypher.internal.v3_5.expressions.{FunctionInvocation, FunctionName, RelationshipPattern} - -object SyntaxDeprecationWarnings extends VisitorPhase[BaseContext, BaseState] { - override def visit(state: BaseState, context: BaseContext): Unit = { - val warnings = findDeprecations(state.statement()) - - warnings.foreach(context.notificationLogger.log) - } - - private def findDeprecations(statement: Statement): Set[InternalNotification] = - statement.treeFold(Set.empty[InternalNotification]) { - case f@FunctionInvocation(_, FunctionName(name), _, _) if aliases.get(name).nonEmpty => - (seq) => (seq + DeprecatedFunctionNotification(f.position, name, aliases(name)), None) - case p@RelationshipPattern(Some(variable), _, Some(_), _, _, _) => - (seq) => (seq + DeprecatedVarLengthBindingNotification(p.position, variable.name), None) - case p@RelationshipPattern(variable, _, length, properties, _, true) if variable.isDefined || length.isDefined || properties.isDefined => - (seq) => (seq + DeprecatedRelTypeSeparatorNotification(p.position), None) - } - - override def phase = DEPRECATION_WARNINGS - - override def description = "find deprecated Cypher constructs and generate warnings for them" -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/Transformer.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/Transformer.scala deleted file mode 100644 index 1577861403f2a..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/phases/Transformer.scala +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.phases - -import org.neo4j.cypher.internal.util.v3_5.AssertionUtils.ifAssertionsEnabled -import org.neo4j.cypher.internal.util.v3_5.InternalException - -trait Transformer[-C <: BaseContext, -FROM, TO] { - def transform(from: FROM, context: C): TO - - def andThen[D <: C, TO2](other: Transformer[D, TO, TO2]): Transformer[D, FROM, TO2] = - new PipeLine(this, other) - - def adds(condition: Condition): Transformer[C, FROM, TO] = this andThen AddCondition[C, TO](condition) - - def name: String -} - -object Transformer { - val identity = new Transformer[BaseContext, Unit, Unit] { - override def transform(from: Unit, context: BaseContext) = () - - override def name: String = "identity" - } -} - -class PipeLine[-C <: BaseContext, FROM, MID, TO](first: Transformer[C, FROM, MID], after: Transformer[C, MID, TO]) extends Transformer[C, FROM, TO] { - - override def transform(from: FROM, context: C): TO = { - val step1 = first.transform(from, context) - - // Checking conditions inside assert so they are not run in production - ifAssertionsEnabled(accumulateAndCheckConditions(step1, first)) - val step2 = after.transform(step1, context) - ifAssertionsEnabled(accumulateAndCheckConditions(step2, after)) - - step2 - } - - private def accumulateAndCheckConditions[D <: C, STATE](from: STATE, transformer: Transformer[D, _, _]): Unit = { - (from, transformer) match { - case (f: BaseState, phase: Phase[_, _, _]) => - val conditions = f.accumulatedConditions ++ phase.postConditions - val messages = conditions.flatMap(condition => condition.check(f)) - if (messages.nonEmpty) { - throw new InternalException(messages.mkString(", ")) - } - case _ => - } - } - - override def name: String = first.name + ", " + after.name -} - - -case class If[-C <: BaseContext, FROM, STATE <: FROM](f: STATE => Boolean)(thenT: Transformer[C, FROM, STATE]) extends Transformer[C, STATE, STATE] { - override def transform(from: STATE, context: C): STATE = { - if (f(from)) - thenT.transform(from, context) - else - from - } - - override def name: String = s"if() ${thenT.name}" -} - -object Do { - def apply[C <: BaseContext, STATE](voidFunction: C => Unit) = new Do[C, STATE, STATE]((from, context) => { - voidFunction(context) - from - }) -} - -case class Do[-C <: BaseContext, FROM, TO](f: (FROM, C) => TO) extends Transformer[C, FROM, TO] { - override def transform(from: FROM, context: C): TO = - f(from, context) - - override def name: String = "do " -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/prettifier/ExpressionStringifier.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/prettifier/ExpressionStringifier.scala deleted file mode 100644 index ffbfca13bbb2a..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/prettifier/ExpressionStringifier.scala +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.prettifier - -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.v3_5.expressions._ - -case class ExpressionStringifier(extender: Expression => String = e => throw new InternalException(s"failed to pretty print $e")) { - def apply(ast: Expression): String = { - ast match { - case StringLiteral(txt) => - var containsSingle = false - var containsDouble = false - txt foreach { - case '"' => containsDouble = true - case '\'' => containsSingle = true - case _ => - } - if (containsDouble && containsSingle) - "\"" + txt.replaceAll("\"", "\\\\\"") + "\"" - else if (containsDouble) - "'" + txt + "'" - else - "\"" + txt + "\"" - - case l: Literal => - l.asCanonicalStringVal - case e: BinaryOperatorExpression => - val op = e match { - case _: StartsWith => "STARTS WITH" - case _: EndsWith => "ENDS WITH" - case _ => e.canonicalOperatorSymbol - } - s"${parens(e, e.lhs)} ${op} ${parens(e, e.rhs)}" - case Variable(v) => - backtick(v) - case ListLiteral(expressions) => - expressions.map(this.apply).mkString("[", ", ", "]") - case FunctionInvocation(namespace, functionName, distinct, args) => - val ns = namespace.parts.mkString(".") - val ds = if (distinct) "DISTINCT " else "" - val as = args.map(this.apply).mkString(", ") - s"$ns${functionName.name}($ds$as)" - case p@Property(m, k) => - s"${parens(p, m)}.${backtick(k.name)}" - case MapExpression(items) => - val is = items.map({ case (k, e) => s"${backtick(k.name)}: ${this.apply(e)}" }).mkString(", ") - s"{$is}" - case Parameter(name, _) => - s"$$${backtick(name)}" - case _: CountStar => - s"count(*)" - case e@IsNull(arg) => - s"${parens(e, arg)} IS NULL" - case e@IsNotNull(arg) => - s"${parens(e, arg)} IS NOT NULL" - case e@ContainerIndex(exp, idx) => - s"${parens(e, exp)}[${this.apply(idx)}]" - case ListSlice(list, start, end) => - val l = start.map(this.apply).getOrElse("") - val r = end.map(this.apply).getOrElse("") - s"${this.apply(list)}[$l..$r]" - case PatternExpression(RelationshipsPattern(relChain)) => - pattern(relChain) - case FilterExpression(scope, expression) => - s"filter${prettyScope(scope, expression)}" - case AnyIterablePredicate(scope, expression) => - s"any${prettyScope(scope, expression)}" - case not@Not(arg) => - s"not ${parens(not, arg)}" - case ListComprehension(s, expression) => - val v = this.apply(s.variable) - val p = s.innerPredicate.map(e => " WHERE " + this.apply(e)).getOrElse("") - val e = s.extractExpression.map(e => " | " + this.apply(e)).getOrElse("") - val expr = this.apply(expression) - s"[$v IN $expr$p$e]" - case ExtractExpression(s, expression) => - val v = this.apply(s.variable) - val p = s.innerPredicate.map(e => " WHERE " + this.apply(e)).getOrElse("") - val e = s.extractExpression.map(e => " | " + this.apply(e)).getOrElse("") - val expr = this.apply(expression) - s"extract($v IN $expr$p$e)" - case PatternComprehension(variable, RelationshipsPattern(relChain), predicate, proj, _) => - val v = variable.map(e => s"${this.apply(e)} = ").getOrElse("") - val p = predicate.map(e => " WHERE " + this.apply(e)).getOrElse("") - s"[$v${pattern(relChain)}$p | ${this.apply(proj)}]" - case e@HasLabels(arg, labels) => - val l = labels.map(label => backtick(label.name)).mkString(":", ":", "") - s"${parens(e, arg)}$l" - case AllIterablePredicate(scope, e) => - s"all${prettyScope(scope, e)}" - case NoneIterablePredicate(scope, e) => - s"none${prettyScope(scope, e)}" - case MapProjection(variable, items, _) => - val itemsText = items.map { - case LiteralEntry(k, e) => s"${backtick(k.name)}: ${this.apply(e)}" - case VariableSelector(v) => this.apply(v) - case PropertySelector(v) => s".${this.apply(v)}" - case AllPropertiesSelector() => ".*" - }.mkString(", ") - s"${this.apply(variable)}{$itemsText}" - case CaseExpression(expression, alternatives, default) => - val e = expression.map(e => s" ${this.apply(e)}").getOrElse("") - val d = default.map(e => s" else ${this.apply(e)} ").getOrElse("") - val items = (alternatives map { - case (e1, e2) => s"when ${this.apply(e1)} then ${this.apply(e2)}" - }).mkString(" ", " ", "") - s"case$e$items${d}end" - case e@Ands(expressions) => - expressions.map(x => parens(e, x)).mkString(" AND ") - case e@Ors(expressions) => - expressions.map(x => parens(e, x)).mkString(" OR ") - case ShortestPathExpression(s@ShortestPaths(r:RelationshipChain, _)) => - s"${s.name}(${pattern(r)})" - case ReduceExpression(ReduceScope(Variable(acc), Variable(identifier), expression), init, list) => - val a = backtick(acc) - val v = backtick(identifier) - val i = this.apply(init) - val l = this.apply(list) - val e = this.apply(expression) - s"reduce($a = $i, $v IN $l | $e)" - case _: ExtractScope | _: FilterScope | _: ReduceScope => - // These are not really expressions, they are part of expressions - "" - case _ => - extender(ast) - } - } - - private def parens(caller: Expression, argument: Expression) = { - val thisPrecedence = precedenceLevel(caller) - val argumentPrecedence = precedenceLevel(argument) - if (argumentPrecedence >= thisPrecedence) - s"(${this.apply(argument)})" - else - this.apply(argument) - } - - private def prettyScope(s: FilterScope, expression: Expression) = { - val v = this.apply(s.variable) - val e = this.apply(expression) - val p = s.innerPredicate.map(this.apply).getOrElse("") - s"($v IN $e WHERE $p)" - } - - private def backtick(txt: String) = { - val needsBackticks = !(Character.isJavaIdentifierStart(txt.head) && txt.tail.forall(Character.isJavaIdentifierPart)) - if (needsBackticks) - s"`$txt`" - else - txt - } - - private def props(prepend: String, e: Option[Expression]): String = { - val separator = if(prepend.isEmpty) "" else " " - e.map(e => s"$separator${this.apply(e)}").getOrElse(prepend) - } - - def node(nodePattern: NodePattern): String = { - val name = nodePattern.variable.map(this.apply).getOrElse("") - val labels = if (nodePattern.labels.isEmpty) "" else - nodePattern.labels.map(l => backtick(l.name)).mkString(":", ":", "") - val e = props(s"$name$labels", nodePattern.properties) - s"($e)" - } - - private def edge(relationship: RelationshipPattern) = { - val lArrow = if (relationship.direction == SemanticDirection.INCOMING) "<" else "" - val rArrow = if (relationship.direction == SemanticDirection.OUTGOING) ">" else "" - val types = if (relationship.types.isEmpty) - "" - else - relationship.types.map(l => backtick(l.name)).mkString(":", ":", "") - val name = relationship.variable.map(this.apply).getOrElse("") - val length = relationship.length match { - case None => "" - case Some(None) => "*" - case Some(Some(Range(lower, upper))) => - s"*${lower.map(_.stringVal).getOrElse("")}..${upper.map(_.stringVal).getOrElse("")}" - } - val info = props(s"$name$types$length", relationship.properties) - if (info == "") - s"$lArrow--$rArrow" - else - s"$lArrow-[$info]-$rArrow" - } - - def pattern(relationshipChain: RelationshipChain): String = { - val r = node(relationshipChain.rightNode) - val middle = edge(relationshipChain.relationship) - val l = relationshipChain.element match { - case r: RelationshipChain => pattern(r) - case n: NodePattern => node(n) - } - - s"$l$middle$r" - } - - private def precedenceLevel(in: Expression): Int = in match { - case _: Or | - _: Ors => - 12 - case _: Xor => - 11 - case _: And | - _: Ands => - 10 - case _: Not => - 9 - case _: Equals | - _: NotEquals | - _: InvalidNotEquals | - _: GreaterThan | - _: GreaterThanOrEqual | - _: LessThan | - _: LessThanOrEqual => - 8 - case _: Add | - _: Subtract => - 7 - case _: Multiply | - _: Divide | - _: Modulo => - 6 - case _: Pow => - 5 - case _: UnaryAdd | - _: UnarySubtract => - 4 - case _: RegexMatch | - _: In | - _: StartsWith | - _: EndsWith | - _: Contains | - _: IsNull | - _: IsNotNull => - 3 - case _: Property | - _: HasLabels | - _: ContainerIndex | - _: ListSlice => - 2 - case _ => - 1 - - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/prettifier/Prettifier.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/prettifier/Prettifier.scala deleted file mode 100644 index 26538d60aa4c5..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/prettifier/Prettifier.scala +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.prettifier - -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.v3_5.expressions._ - -case class Prettifier(mkStringOf: ExpressionStringifier) { - def asString(statement: Statement): String = statement match { - case Query(_, SingleQuery(clauses)) => - clauses.map(dispatch).mkString(NL) - } - - private def dispatch(clause: Clause) = clause match { - case e: Return => asString(e) - case m: Match => asString(m) - case w: With => asString(w) - case c: Create => asString(c) - case u: Unwind => asString(u) - case _ => clause.asCanonicalStringVal // TODO - } - - private def NL = System.lineSeparator() - - def asString(element: PatternElement): String = element match { - case r: RelationshipChain => mkStringOf.pattern(r) - case n: NodePattern => mkStringOf.node(n) - } - - def asString(p: PatternPart): String = p match { - case EveryPath(element) => asString(element) - case NamedPatternPart(variable, patternPart) => s"${mkStringOf(variable)} = ${asString(patternPart)}" - case ShortestPaths(pattern, single) => - val name = if(single) "shortestPath" else "shortestPaths" - s"$name(${asString(pattern)})" - } - - def asString(m: Match): String = { - val o = if(m.optional) "OPTIONAL " else "" - val p = m.pattern.patternParts.map(p => asString(p)).mkString(", ") - val w = m.where.map(w => NL + " WHERE " + mkStringOf(w.expression)).getOrElse("") - s"${o}MATCH $p$w" - } - - private def asString(o: Skip): String = "SKIP " + mkStringOf(o.expression) - private def asString(o: Limit): String = "LIMIT " + mkStringOf(o.expression) - - private def asString(o: OrderBy): String = "ORDER BY " + { - o.sortItems.map { - case AscSortItem(expression) => mkStringOf(expression) + " ASCENDING" - case DescSortItem(expression) => mkStringOf(expression) + " DESCENDING" - }.mkString(", ") - } - - private def asString(r: ReturnItem): String = r match { - case AliasedReturnItem(e, v) => mkStringOf(e) + " AS " + mkStringOf(v) - case UnaliasedReturnItem(e, _) => mkStringOf(e) - } - - private def asString(r: Return): String = { - val d = if (r.distinct) " DISTINCT" else "" - val i = r.returnItems.items.map(asString).mkString(", ") - val o = r.orderBy.map(NL + " " + asString(_)).getOrElse("") - val l = r.limit.map(NL + " " + asString(_)).getOrElse("") - val s = r.skip.map(NL + " " + asString(_)).getOrElse("") - s"RETURN$d $i$o$s$l" - } - - private def asString(w: With): String = { - val d = if (w.distinct) " DISTINCT" else "" - val i = w.returnItems.items.map(asString).mkString(", ") - val o = w.orderBy.map(NL + " " + asString(_)).getOrElse("") - val l = w.limit.map(NL + " " + asString(_)).getOrElse("") - val s = w.skip.map(NL + " " + asString(_)).getOrElse("") - val wh = w.where.map(w => NL + " WHERE " + mkStringOf(w.expression)).getOrElse("") - s"WITH$d $i$o$s$l$wh" - } - - private def asString(u:Unwind) = s"UNWIND ${mkStringOf(u.expression)} AS ${mkStringOf(u.variable)}" - - private def asString(c: Create): String = { - val p = c.pattern.patternParts.map(p => asString(p)).mkString(", ") - s"CREATE $p" - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticAnalysisTooling.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticAnalysisTooling.scala deleted file mode 100644 index 259ad2e49a040..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticAnalysisTooling.scala +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.util.v3_5.symbols.{TypeSpec, _} -import org.neo4j.cypher.internal.frontend.v3_5.{SemanticCheck, TypeGenerator} -import org.neo4j.cypher.internal.v3_5.expressions.Expression.{DefaultTypeMismatchMessageGenerator, SemanticContext} -import org.neo4j.cypher.internal.v3_5.expressions._ - -/** - * This class holds methods for performing semantic analysis. - */ -trait SemanticAnalysisTooling { - - def semanticCheckFold[A]( - traversable: Traversable[A] - )( - f:A => SemanticCheck - ): SemanticCheck = - state => traversable.foldLeft(SemanticCheckResult.success(state)){ - (r1:SemanticCheckResult, o:A) => { - val r2 = f(o)(r1.state) - SemanticCheckResult(r2.state, r1.errors ++ r2.errors) - } - } - - def semanticCheck[A <: SemanticCheckable](traversable: TraversableOnce[A]): SemanticCheck = - state => traversable.foldLeft(SemanticCheckResult.success(state)){ - (r1:SemanticCheckResult, o:A) => { - val r2 = o.semanticCheck(r1.state) - SemanticCheckResult(r2.state, r1.errors ++ r2.errors) - } - } - - def specifyType(typeGen: TypeGenerator, expression: Expression): SemanticState => Either[SemanticError, SemanticState] = - s => specifyType(typeGen(s), expression)(s) - - def specifyType(possibleTypes: => TypeSpec, expression: Expression): SemanticState => Either[SemanticError, SemanticState] = - _.specifyType(expression, possibleTypes) - - def expectType(typeGen: TypeGenerator, expression: Expression): SemanticCheck = - s => expectType(typeGen(s), expression)(s) - - def expectType(possibleTypes: TypeSpec, opt: Option[Expression]): SemanticCheck = - opt.map(expectType(possibleTypes, _)).getOrElse(SemanticCheckResult.success) - - def expectType(typeGen: TypeGenerator, expression: Expression, messageGen: (String, String) => String): SemanticCheck = - s => expectType(typeGen(s), expression, messageGen)(s) - - def expectType[Exp <: Expression](possibleTypes: TypeSpec, expressions:Traversable[Exp]):SemanticCheck = - state => expressions.foldLeft(SemanticCheckResult.success(state)){ - (r1:SemanticCheckResult, o:Exp) => { - val r2 = expectType(possibleTypes, o)(r1.state) - SemanticCheckResult(r2.state, r1.errors ++ r2.errors) - } - } - - def expectType( - possibleTypes: => TypeSpec - )( - ctx: SemanticContext, - expr:Expression - ): SemanticCheck = expectType(possibleTypes, expr) - - def expectType( - possibleTypes: => TypeSpec, - expression: Expression, - messageGen: (String, String) => String = DefaultTypeMismatchMessageGenerator - ): SemanticCheck = s => { - s.expectType(expression, possibleTypes) match { - case (ss, TypeSpec.none) => - val existingTypesString = ss.expressionType(expression).specified.mkString(", ", " or ") - val expectedTypesString = possibleTypes.mkString(", ", " or ") - SemanticCheckResult.error(ss, - SemanticError("Type mismatch: " + messageGen(expectedTypesString, existingTypesString), expression.position)) - case (ss, _) => - SemanticCheckResult.success(ss) - } - } - - def checkTypes(expression: Expression, signatures: Seq[TypeSignature]): SemanticCheck = s => { - val initSignatures = signatures.filter(_.argumentTypes.length == expression.arguments.length) - - val (remainingSignatures: Seq[TypeSignature], result) = - expression.arguments.foldLeft((initSignatures, SemanticCheckResult.success(s))) { - case (accumulator@(Seq(), _), _) => - accumulator - case ((possibilities, r1), arg) => - val argTypes = possibilities.foldLeft(TypeSpec.none) { _ | _.argumentTypes.head.covariant } - val r2 = expectType(argTypes, arg)(r1.state) - - val actualTypes = types(arg)(r2.state) - val remainingPossibilities = possibilities.filter { - sig => actualTypes containsAny sig.argumentTypes.head.covariant - } map { - sig => sig.copy(argumentTypes = sig.argumentTypes.tail) - } - (remainingPossibilities, SemanticCheckResult(r2.state, r1.errors ++ r2.errors)) - } - - val outputType = remainingSignatures match { - case Seq() => TypeSpec.all - case _ => remainingSignatures.foldLeft(TypeSpec.none) { _ | _.outputType.invariant } - } - - specifyType(outputType, expression)(result.state) match { - case Left(err) => SemanticCheckResult(result.state, result.errors :+ err) - case Right(state) => SemanticCheckResult(state, result.errors) - } - } - - def when(condition: Boolean)(check: => SemanticCheck): SemanticCheck = state => - if (condition) - check(state) - else - SemanticCheckResult.success(state) - - def unless(condition: Boolean)(check: => SemanticCheck): SemanticCheck = state => - if (condition) - SemanticCheckResult.success(state) - else - check(state) - - def unionOfTypes(traversable: TraversableOnce[Expression]): TypeGenerator = state => - TypeSpec.union(traversable.map(types(_)(state)).toSeq: _*) - - def leastUpperBoundsOfTypes(traversable: TraversableOnce[Expression]): TypeGenerator = - if (traversable.isEmpty) - _ => CTAny.invariant - else - state => traversable.map { types(_)(state) } reduce { _ leastUpperBounds _ } - - val pushStateScope: SemanticCheck = state => SemanticCheckResult.success(state.newChildScope) - val popStateScope: SemanticCheck = state => SemanticCheckResult.success(state.popScope) - def withScopedState(check: => SemanticCheck): SemanticCheck = - pushStateScope chain check chain popStateScope - - def typeSwitch(expr: Expression)(choice: TypeSpec => SemanticCheck): SemanticCheck = - (state: SemanticState) => choice(state.expressionType(expr).actual)(state) - - def validNumber(long:IntegerLiteral): Boolean = - try { - long.value.isInstanceOf[Long] - } catch { - case e:java.lang.NumberFormatException => false - } - - def validNumber(double:DoubleLiteral): Boolean = - try { - double.value.isInstanceOf[Double] - } catch { - case e:java.lang.NumberFormatException => false - } - - def ensureDefined(v:LogicalVariable): (SemanticState) => Either[SemanticError, SemanticState] = - (_: SemanticState).ensureVariableDefined(v) - - def declareVariable(v:LogicalVariable, possibleTypes: TypeSpec): (SemanticState) => Either[SemanticError, SemanticState] = - (_: SemanticState).declareVariable(v, possibleTypes) - - def declareVariable( - v:LogicalVariable, - typeGen: TypeGenerator, - positions: Set[InputPosition] = Set.empty - ): (SemanticState) => Either[SemanticError, SemanticState] = - (s: SemanticState) => s.declareVariable(v, typeGen(s), positions) - - def implicitVariable(v:LogicalVariable, possibleType: CypherType): (SemanticState) => Either[SemanticError, SemanticState] = - (_: SemanticState).implicitVariable(v, possibleType) - - def declareGraph(v:Variable): (SemanticState) => Either[SemanticError, SemanticState] = - (_: SemanticState).declareGraph(v) - - def declareGraphMarkedAsGenerated(v:Variable): SemanticCheck = { - val declare = (_: SemanticState).declareGraph(v) - val mark = (_: SemanticState).localMarkAsGenerated(v) - declare chain mark - } - - def implicitGraph(v:Variable): (SemanticState) => Either[SemanticError, SemanticState] = - (_: SemanticState).implicitGraph(v) - - def ensureGraphDefined(v:Variable): SemanticCheck = { - val ensured = (_: SemanticState).ensureGraphDefined(v) - ensured chain expectType(CTGraphRef.covariant, v) - } - - def requireMultigraphSupport(msg: String, position: InputPosition): SemanticCheck = - s => { - if(!s.features(SemanticFeature.MultipleGraphs)) - SemanticCheckResult(s, - List(FeatureError(s"$msg is not available in this implementation of Cypher " + - "due to lack of support for multiple graphs.", position))) - else - SemanticCheckResult.success(s) - } - - def error(msg: String, position: InputPosition)(state: SemanticState): SemanticCheckResult = - SemanticCheckResult(state, Vector(SemanticError(msg, position))) - - def possibleTypes(expression: Expression) : TypeGenerator = - types(expression)(_).unwrapLists - - def types(expression:Expression): TypeGenerator = _.expressionType(expression).actual -} - diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticCheck.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticCheck.scala deleted file mode 100644 index fdcdb0b6b96f4..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticCheck.scala +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.frontend.v3_5.SemanticCheck -import org.neo4j.cypher.internal.v3_5.expressions.Expression.SemanticContext - -object SemanticCheckResult { - val success: SemanticCheck = SemanticCheckResult(_, Vector()) - def error(state: SemanticState, error: SemanticErrorDef): SemanticCheckResult = SemanticCheckResult(state, Vector(error)) - def error(state: SemanticState, error: Option[SemanticErrorDef]): SemanticCheckResult = SemanticCheckResult(state, error.toVector) -} - -case class SemanticCheckResult(state: SemanticState, errors: Seq[SemanticErrorDef]) - -class OptionSemanticChecking[A](val option: Option[A]) extends AnyVal { - def foldSemanticCheck(check: A => SemanticCheck): SemanticCheck = - option.fold(SemanticCheckResult.success)(check) -} - -class TraversableOnceSemanticChecking[A](val traversable: TraversableOnce[A]) extends AnyVal { - def foldSemanticCheck(check: A => SemanticCheck): SemanticCheck = state => traversable.foldLeft(SemanticCheckResult.success(state)) { - (r1, o) => - val r2 = check(o)(r1.state) - SemanticCheckResult(r2.state, r1.errors ++ r2.errors) - } -} - -class ChainableSemanticCheck(val check: SemanticCheck) extends AnyVal { - def chain(next: SemanticCheck): SemanticCheck = state => { - val r1 = check(state) - val r2 = next(r1.state) - SemanticCheckResult(r2.state, r1.errors ++ r2.errors) - } - - def ifOkChain(next: => SemanticCheck): SemanticCheck = state => { - val r1 = check(state) - if (r1.errors.nonEmpty) - r1 - else - next(r1.state) - } -} - -trait SemanticCheckable { - def semanticCheck: SemanticCheck -} - -trait SemanticCheckableExpression { - def semanticCheck(ctx:SemanticContext): SemanticCheck -} - -class SemanticCheckableOption[A <: SemanticCheckable](val option: Option[A]) extends AnyVal { - def semanticCheck: SemanticCheck = option.fold(SemanticCheckResult.success) { _.semanticCheck } -} - -class SemanticCheckableTraversableOnce[A <: SemanticCheckable](val traversable: TraversableOnce[A]) extends AnyVal { - def semanticCheck: SemanticCheck = traversable.foldSemanticCheck { _.semanticCheck } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticChecker.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticChecker.scala deleted file mode 100644 index 6b9a0c9e2dc67..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticChecker.scala +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.frontend.v3_5.ScopeTreeVerifier -import org.neo4j.cypher.internal.frontend.v3_5.ast.Statement - -object SemanticChecker { - def check(statement: Statement, state: SemanticState = SemanticState.clean): SemanticCheckResult = { - val result = statement.semanticCheck(state) - val scopeTreeIssues = ScopeTreeVerifier.verify(result.state.scopeTree) - if (scopeTreeIssues.nonEmpty) - throw new InternalException(scopeTreeIssues.mkString(s"\n")) - - result - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticError.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticError.scala deleted file mode 100644 index 71fddaa975f3a..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticError.scala +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.InputPosition - -sealed trait SemanticErrorDef { - def msg: String - def position: InputPosition - def references: Seq[InputPosition] -} - -final case class SemanticError(msg: String, position: InputPosition, references: InputPosition*) extends SemanticErrorDef - -sealed trait UnsupportedOpenCypher extends SemanticErrorDef - -final case class FeatureError(msg: String, position: InputPosition) extends UnsupportedOpenCypher { - override def references = Seq.empty -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticExpressionCheck.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticExpressionCheck.scala deleted file mode 100644 index f033241ed817c..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticExpressionCheck.scala +++ /dev/null @@ -1,643 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.v3_5.expressions.Expression.SemanticContext -import org.neo4j.cypher.internal.v3_5.expressions.ReduceExpression.AccumulatorExpressionTypeMismatchMessageGenerator -import org.neo4j.cypher.internal.v3_5.expressions._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.DesugaredMapProjection -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.frontend.v3_5.{SemanticCheck, TypeGenerator, ast} - -import scala.util.Try - -object SemanticExpressionCheck extends SemanticAnalysisTooling { - - val crashOnUnknownExpression: (SemanticContext, Expression) => SemanticCheck = - (ctx, e) => throw new UnsupportedOperationException(s"Error in semantic analysis: Unknown expression $e") - - /** - * This fallback allow for a testing backdoor to insert custom Expressions. Do not use in production. - */ - var semanticCheckFallback: (SemanticContext, Expression) => SemanticCheck = crashOnUnknownExpression - - /** - * Build a semantic check for the given expression using the simple expression context. - */ - def simple(expression: Expression): SemanticCheck = check(SemanticContext.Simple, expression) - - /** - * Build a semantic check for the given expression and context. - */ - def check(ctx: SemanticContext, expression: Expression): SemanticCheck = - expression match { - - // ARITHMETICS - - case x:Add => - check(ctx, x.lhs) chain - expectType(TypeSpec.all, x.lhs) chain - check(ctx, x.rhs) chain - expectType(infixAddRhsTypes(x.lhs), x.rhs) chain - specifyType(infixAddOutputTypes(x.lhs, x.rhs), x) chain - checkAddBoundary(x) - - case x:Subtract => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) chain - checkSubtractBoundary(x) - - case x:UnarySubtract => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) - - case x:Multiply => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) chain - checkMultiplyBoundary(x) - - case x:Divide => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) - - case x:Modulo => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) - - case x:Pow => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) - - // PREDICATES - - case x:Not => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) - - case x:Equals => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) - - case x:NotEquals => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) - - case x:InvalidNotEquals => - SemanticError( - "Unknown operation '!=' (you probably meant to use '<>', which is the operator for inequality testing)", - x.position) - - case x:RegexMatch => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) - - case x:And => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) - - case x:Or => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) - - case x:Xor => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) - - case x:Ands => - check(ctx, x.exprs) - - case x:Ors => - SemanticCheckResult.success - - case x:In => - check(ctx, x.lhs) chain - expectType(CTAny.covariant, x.lhs) chain - check(ctx, x.rhs) chain - expectType(CTList(CTAny).covariant, x.rhs) chain - specifyType(CTBoolean, x) - - case x:StartsWith => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) - - case x:EndsWith => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) - - case x:Contains => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) - - case x:IsNull => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) - - case x:IsNotNull => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) - - case x:LessThan => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) - - case x:LessThanOrEqual => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) - - case x:GreaterThan => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) - - case x:GreaterThanOrEqual => - check(ctx, x.arguments) chain - checkTypes(x, x.signatures) - - case x:PartialPredicate[_] => - check(ctx, x.coveredPredicate) - - // - - case x:CaseExpression => - val possibleTypes = unionOfTypes(x.possibleExpressions) - SemanticExpressionCheck.check(ctx, x.expression) chain - check(ctx, x.alternatives.flatMap { a => Seq(a._1, a._2) }) chain - check(ctx, x.default) chain - when (x.expression.isEmpty) { - expectType(CTBoolean.covariant, x.alternatives.map(_._1)) - } chain - specifyType(possibleTypes, x) - - case x:AndedPropertyInequalities => - x.inequalities.map(check(ctx, _)).reduceLeft(_ chain _) - - case x:CoerceTo => - check(ctx, x.expr) chain expectType(x.typ.covariant, x.expr) - - case x:Property => - check(ctx, x.map) chain - expectType(CTMap.covariant | CTNode.covariant | CTRelationship.covariant | CTPoint.covariant | CTDate.covariant | CTTime.covariant | - CTLocalTime.covariant | CTLocalDateTime.covariant | CTDateTime.covariant | CTDuration.covariant| CTAny.invariant, x.map) chain - specifyType(CTAny.covariant, x) - - // Check the variable is defined and, if not, define it so that later errors are suppressed - // This is used in expressions; in graphs we must make sure to sem check variables explicitly (!) - case x:Variable => - s => s.ensureVariableDefined(x) match { - case Right(ss) => SemanticCheckResult.success(ss) - case Left(error) => s.declareVariable(x, CTAny.covariant) match { - // if the variable is a graph, declaring it will fail - case Right(ss) => SemanticCheckResult.error(ss, error) - case Left(_error) => SemanticCheckResult.error(s, _error) - } - } - - case x:FunctionInvocation => - SemanticFunctionCheck.check(ctx, x) - - case x:GetDegree => - check(ctx, x.node) chain - expectType(CTMap.covariant | CTAny.invariant, x.node) chain - specifyType(CTAny.covariant, x) - - case x:Parameter => - specifyType(x.parameterType.covariant, x) - - case x:HasLabels => - check(ctx, x.expression) chain - expectType(CTNode.covariant, x.expression) chain - specifyType(CTBoolean, x) - - // ITERABLES - - case x:FilterExpression => - FilteringExpressions.checkPredicateDefined(x) chain - FilteringExpressions.semanticCheck(ctx, x) chain - specifyType(types(x.expression), x) - - case x:ExtractExpression => - FilteringExpressions.checkPredicateNotDefined(x) chain - checkExtractExpressionDefined(x) chain - FilteringExpressions.semanticCheck(ctx, x) chain - checkInnerExtractExpression(x) chain - FilteringExpressions.failIfAggregating(x.extractExpression) - - case x:ListComprehension => - FilteringExpressions.semanticCheck(ctx, x) chain - checkInnerListComprehension(x) chain - FilteringExpressions.failIfAggregating(x.extractExpression) - - case x:PatternComprehension => - SemanticState.recordCurrentScope(x) chain - withScopedState { - SemanticPatternCheck.check(Pattern.SemanticContext.Match, x.pattern) chain - x.namedPath.map(declareVariable(_, CTPath): SemanticCheck).getOrElse(SemanticCheckResult.success) chain - simple(x.predicate) chain - simple(x.projection) - } chain { - val outerTypes: TypeGenerator = types(x.projection)(_).wrapInList - specifyType(outerTypes, x) - } - - case _:FilterScope => SemanticCheckResult.success - case _:ExtractScope => SemanticCheckResult.success - case _:ReduceScope => SemanticCheckResult.success - - case x:CountStar => - specifyType(CTInteger, x) - - case x:PathExpression => - specifyType(CTPath, x) - - case x:ShortestPathExpression => - SemanticPatternCheck.declareVariables(Pattern.SemanticContext.Expression)(x.pattern) chain - SemanticPatternCheck.check(Pattern.SemanticContext.Expression)(x.pattern) chain - specifyType(if (x.pattern.single) CTPath else CTList(CTPath), x) - - case x:PatternExpression => - SemanticPatternCheck.check(Pattern.SemanticContext.Expression, x.pattern) chain - specifyType(CTList(CTPath), x) - - case x:IterablePredicateExpression => - FilteringExpressions.checkPredicateDefined(x) chain - FilteringExpressions.semanticCheck(ctx, x) chain - specifyType(CTBoolean, x) - - case x:ReduceExpression => - check(ctx, x.init) chain - check(ctx, x.list) chain - expectType(CTList(CTAny).covariant, x.list) chain - withScopedState { - val indexType: TypeGenerator = s => - (types(x.list)(s) constrain CTList(CTAny)).unwrapLists - val accType: TypeGenerator = types(x.init) - - declareVariable(x.variable, indexType) chain - declareVariable(x.accumulator, accType) chain - check(SemanticContext.Simple, x.expression) - } chain - expectType(types(x.init), x.expression, AccumulatorExpressionTypeMismatchMessageGenerator) chain - specifyType(s => types(x.init)(s) leastUpperBounds types(x.expression)(s), x) chain - FilteringExpressions.failIfAggregating(x.expression) - - case x:ListLiteral => - def possibleTypes: TypeGenerator = state => x.expressions match { - case Seq() => CTList(CTAny).covariant - case _ => leastUpperBoundsOfTypes(x.expressions)(state).wrapInCovariantList - } - check(ctx, x.expressions) chain specifyType(possibleTypes, x) - - case x:ListSlice => - check(ctx, x.list) chain - expectType(CTList(CTAny).covariant, x.list) chain - when(x.from.isEmpty && x.to.isEmpty) { - SemanticError("The start or end (or both) is required for a collection slice", x.position) - } chain - check(ctx, x.from) chain - expectType(CTInteger.covariant, x.from) chain - check(ctx, x.to) chain - expectType(CTInteger.covariant, x.to) chain - specifyType(types(x.list), x) - - case x:ContainerIndex => - check(ctx, x.expr) chain - check(ctx, x.idx) chain - typeSwitch(x.expr) { - case exprT => - typeSwitch(x.idx) { - case idxT => - val listT = CTList(CTAny).covariant & exprT - val mapT = CTMap.covariant & exprT - val exprIsList = listT != TypeSpec.none - val exprIsMap = mapT != TypeSpec.none - val idxIsInteger = (CTInteger.covariant & idxT) != TypeSpec.none - val idxIsString = (CTString.covariant & idxT) != TypeSpec.none - val listLookup = exprIsList || idxIsInteger - val mapLookup = exprIsMap || idxIsString - - if (listLookup && !mapLookup) { - expectType(CTList(CTAny).covariant, x.expr) chain - expectType(CTInteger.covariant, x.idx) chain - specifyType(types(x.expr)(_).unwrapLists, x) - } - else if (!listLookup && mapLookup) { - expectType(CTMap.covariant, x.expr) chain - expectType(CTString.covariant, x.idx) - } else { - SemanticCheckResult.success - } - } - } - - // MAPS - - case x:MapExpression => - check(ctx, x.items.map(_._2)) chain - specifyType(CTMap, x) - - case x:MapProjection => - check(ctx, x.items) chain - specifyType(CTMap, x) ifOkChain // We need to remember the scope to later rewrite this ASTNode - SemanticState.recordCurrentScope(x) - - case x:LiteralEntry => - check(ctx, x.exp) - - case x:VariableSelector => - check(ctx, x.id) - - case x:PropertySelector => - SemanticCheckResult.success - - case x:AllPropertiesSelector => - SemanticCheckResult.success - - case x:DesugaredMapProjection => - check(ctx, x.items) chain - ensureDefined(x.name) chain - specifyType(CTMap, x) ifOkChain // We need to remember the scope to later rewrite this ASTNode - SemanticState.recordCurrentScope(x) - - - // LITERALS - - case x:DecimalIntegerLiteral => - when(!validNumber(x)) { - if (x.stringVal matches "^-?[1-9][0-9]*$") - SemanticError("integer is too large", x.position) - else - SemanticError("invalid literal number", x.position) - } chain specifyType(CTInteger, x) - - case x:OctalIntegerLiteral => - when(!validNumber(x)) { - if (x.stringVal matches "^-?0[0-7]+$") - SemanticError("integer is too large", x.position) - else - SemanticError("invalid literal number", x.position) - } chain specifyType(CTInteger, x) - - case x:HexIntegerLiteral => - when(!validNumber(x)) { - if (x.stringVal matches "^-?0x[0-9a-fA-F]+$") - SemanticError("integer is too large", x.position) - else - SemanticError("invalid literal number", x.position) - } chain specifyType(CTInteger, x) - - case x:DecimalDoubleLiteral => - when(!validNumber(x)) { - SemanticError("invalid literal number", x.position) - } ifOkChain - when(x.value.isInfinite) { - SemanticError("floating point number is too large", x.position) - } chain specifyType(CTFloat, x) - - case x:StringLiteral => - specifyType(CTString, x) - - case x:Null => - specifyType(CTAny.covariant, x) - - case x:BooleanLiteral => - specifyType(CTBoolean, x) - - case x:SemanticCheckableExpression => - x.semanticCheck(ctx) - - case x:Expression => semanticCheckFallback(ctx, x) - } - - /** - * Build a semantic check over a traversable of expressions. - */ - def simple(traversable: Traversable[Expression]): SemanticCheck = check(SemanticContext.Simple, traversable) - - def check( - ctx: SemanticContext, - traversable: Traversable[Expression] - ): SemanticCheck = - semanticCheckFold(traversable)(expr => check(ctx, expr)) - - /** - * Build a semantic check over an optional expression. - */ - def simple(option: Option[Expression]): SemanticCheck = check(SemanticContext.Simple, option) - - def check(ctx: SemanticContext, option: Option[Expression]): SemanticCheck = - option.fold(SemanticCheckResult.success) { - check(ctx, _) - } - - object FilteringExpressions { - - def semanticCheck(ctx: SemanticContext, e: FilteringExpression):SemanticCheck = - SemanticExpressionCheck.check(ctx, e.expression) chain - expectType(CTList(CTAny).covariant, e.expression) chain - checkInnerPredicate(e) chain - failIfAggregating(e.innerPredicate) - - def failIfAggregating(expression: Option[Expression]): Option[SemanticError] = - expression.flatMap(failIfAggregating) - - def failIfAggregating(expression: Expression): Option[SemanticError] = - expression.findAggregate.map( - aggregate => - SemanticError("Can't use aggregating expressions inside of expressions executing over lists", aggregate.position) - ) - - def checkPredicateDefined(e: FilteringExpression): SemanticCheck = - when (e.innerPredicate.isEmpty) { - SemanticError(s"${e.name}(...) requires a WHERE predicate", e.position) - } - - def checkPredicateNotDefined(e: FilteringExpression): SemanticCheck = - when (e.innerPredicate.isDefined) { - SemanticError(s"${e.name}(...) should not contain a WHERE predicate", e.position) - } - - private def checkInnerPredicate(e: FilteringExpression): SemanticCheck = - e.innerPredicate match { - case Some(predicate) => withScopedState { - declareVariable(e.variable, possibleInnerTypes(e)) chain - SemanticExpressionCheck.check(SemanticContext.Simple, predicate) - } - case None => SemanticCheckResult.success - } - - def possibleInnerTypes(e: FilteringExpression): TypeGenerator = s => - (types(e.expression)(s) constrain CTList(CTAny)).unwrapLists - } - - private def checkAddBoundary(add: Add): SemanticCheck = - (add.lhs, add.rhs) match { - case (l:IntegerLiteral, r:IntegerLiteral) if Try(Math.addExact(l.value, r.value)).isFailure => - SemanticError(s"result of ${l.stringVal} + ${r.stringVal} cannot be represented as an integer", add.position) - case _ => SemanticCheckResult.success - } - - private def checkSubtractBoundary(subtract: Subtract): SemanticCheck = - (subtract.lhs, subtract.rhs) match { - case (l:IntegerLiteral, r:IntegerLiteral) if Try(Math.subtractExact(l.value, r.value)).isFailure => - SemanticError(s"result of ${l.stringVal} - ${r.stringVal} cannot be represented as an integer", subtract.position) - case _ => SemanticCheckResult.success - } - - private def checkMultiplyBoundary(multiply: Multiply): SemanticCheck = - (multiply.lhs, multiply.rhs) match { - case (l:IntegerLiteral, r:IntegerLiteral) if Try(Math.multiplyExact(l.value, r.value)).isFailure => - SemanticError(s"result of ${l.stringVal} * ${r.stringVal} cannot be represented as an integer", multiply.position) - case _ => SemanticCheckResult.success - } - - private def infixAddRhsTypes(lhs: Expression): TypeGenerator = s => { - val lhsTypes = types(lhs)(s) - - // Strings - // "a" + "b" => "ab" - // "a" + 1 => "a1" - // "a" + 1.1 => "a1.1" - // Numbers - // 1 + "b" => "1b" - // 1 + 1 => 2 - // 1 + 1.1 => 2.1 - // 1.1 + "b" => "1.1b" - // 1.1 + 1 => 2.1 - // 1.1 + 1.1 => 2.2 - // Temporals - // T + Duration => T - // Duration + T => T - // Duration + Duration => Duration - val valueTypes = - if (lhsTypes containsAny (CTInteger.covariant | CTFloat.covariant | CTString.covariant)) - CTString.covariant | CTInteger.covariant | CTFloat.covariant - else - TypeSpec.none - - val temporalTypes = - if (lhsTypes containsAny (CTDate.covariant | CTTime.covariant | CTLocalTime.covariant | - CTDateTime.covariant | CTLocalDateTime.covariant | CTDuration.covariant)) - CTDuration.covariant - else - TypeSpec.none - - val durationTypes = - if (lhsTypes containsAny (CTDuration.covariant)) - CTDate.covariant | CTTime.covariant | CTLocalTime.covariant | - CTDateTime.covariant | CTLocalDateTime.covariant | CTDuration.covariant - else - TypeSpec.none - - // [a] + [b] => [a, b] - val listTypes = (lhsTypes leastUpperBounds CTList(CTAny) constrain CTList(CTAny)).covariant - - // [a] + b => [a, b] - val lhsListTypes = listTypes | listTypes.unwrapLists - - // a + [b] => [a, b] - val rhsListTypes = CTList(CTAny).covariant - - valueTypes | lhsListTypes | rhsListTypes | temporalTypes | durationTypes - } - - private def infixAddOutputTypes(lhs: Expression, rhs: Expression): TypeGenerator = s => { - val lhsTypes = types(lhs)(s) - val rhsTypes = types(rhs)(s) - - def when(fst: TypeSpec, snd: TypeSpec)(result: CypherType): TypeSpec = - if (lhsTypes.containsAny(fst) && rhsTypes.containsAny(snd) || lhsTypes.containsAny(snd) && rhsTypes.containsAny(fst)) - result.invariant - else - TypeSpec.none - - // "a" + "b" => "ab" - // "a" + 1 => "a1" - // "a" + 1.1 => "a1.1" - // 1 + "b" => "1b" - // 1.1 + "b" => "1.1b" - val stringTypes: TypeSpec = - when(CTString.covariant, CTInteger.covariant | CTFloat.covariant | CTString.covariant)(CTString) - - // 1 + 1 => 2 - // 1 + 1.1 => 2.1 - // 1.1 + 1 => 2.1 - // 1.1 + 1.1 => 2.2 - val numberTypes: TypeSpec = - when(CTInteger.covariant, CTInteger.covariant)(CTInteger) | - when(CTFloat.covariant, CTFloat.covariant | CTInteger.covariant)(CTFloat) - - val temporalTypes: TypeSpec = - when(CTDuration.covariant, CTDuration.covariant)(CTDuration) | - when(CTDate.covariant, CTDuration.covariant)(CTDate) | - when(CTDuration.covariant, CTDate.covariant)(CTDate) | - when(CTTime.covariant, CTDuration.covariant)(CTTime) | - when(CTDuration.covariant, CTTime.covariant)(CTTime) | - when(CTLocalTime.covariant, CTDuration.covariant)(CTLocalTime) | - when(CTDuration.covariant, CTLocalTime.covariant)(CTLocalTime) | - when(CTLocalDateTime.covariant, CTDuration.covariant)(CTLocalDateTime) | - when(CTDuration.covariant, CTLocalDateTime.covariant)(CTLocalDateTime) | - when(CTDateTime.covariant, CTDuration.covariant)(CTDateTime) | - when(CTDuration.covariant, CTDateTime.covariant)(CTDateTime) - - val listTypes = { - val lhsListTypes = lhsTypes constrain CTList(CTAny) - val rhsListTypes = rhsTypes constrain CTList(CTAny) - val lhsListInnerTypes = lhsListTypes.unwrapLists - val rhsListInnerTypes = rhsListTypes.unwrapLists - val lhsScalarTypes = lhsTypes without CTList(CTAny) - val rhsScalarTypes = rhsTypes without CTList(CTAny) - - val bothListMergedTypes = (lhsListInnerTypes coerceOrLeastUpperBound rhsListInnerTypes).wrapInList - val lhListMergedTypes = (rhsScalarTypes coerceOrLeastUpperBound lhsListInnerTypes).wrapInList - val rhListMergedTypes = (lhsScalarTypes coerceOrLeastUpperBound rhsListInnerTypes).wrapInList - - bothListMergedTypes | lhListMergedTypes | rhListMergedTypes - } - - stringTypes | numberTypes | listTypes | temporalTypes - } - - private def checkExtractExpressionDefined(x: ExtractExpression): SemanticCheck = - when (x.scope.extractExpression.isEmpty) { - SemanticError(s"${x.name}(...) requires '| expression' (an extract expression)", x.position) - } - - private def checkInnerExtractExpression(x: ExtractExpression): SemanticCheck = - x.scope.extractExpression.fold(SemanticCheckResult.success) { - e => withScopedState { - declareVariable(x.variable, FilteringExpressions.possibleInnerTypes(x)) chain - check(SemanticContext.Simple, e) - } chain { - val outerTypes: TypeGenerator = types(e)(_).wrapInList - specifyType(outerTypes, x) - } - } - - private def checkInnerListComprehension(x: ListComprehension): SemanticCheck = - x.extractExpression match { - case Some(e) => - withScopedState { - declareVariable(x.variable, FilteringExpressions.possibleInnerTypes(x)) chain - check(SemanticContext.Simple, e) - } chain { - val outerTypes: TypeGenerator = types(e)(_).wrapInList - specifyType(outerTypes, x) - } - case None => - specifyType(types(x.expression), x) - } -} - diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticFeature.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticFeature.scala deleted file mode 100644 index 386efaf39a984..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticFeature.scala +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -sealed trait SemanticFeature - -object SemanticFeature { - case object MultipleGraphs extends SemanticFeature - case object WithInitialQuerySignature extends SemanticFeature -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticFunctionCheck.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticFunctionCheck.scala deleted file mode 100644 index 5d7567b81a338..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticFunctionCheck.scala +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.v3_5.expressions.Expression.SemanticContext -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.v3_5.functions._ -import org.neo4j.cypher.internal.frontend.v3_5.notification.LengthOnNonPathNotification -import org.neo4j.cypher.internal.util.v3_5.symbols.{CTAny, CTBoolean, CTList, CTPath, CTString} -import org.neo4j.cypher.internal.frontend.v3_5.{SemanticCheck, TypeGenerator, ast} -import org.neo4j.cypher.internal.v3_5.expressions._ - -object SemanticFunctionCheck extends SemanticAnalysisTooling { - - def check(ctx: Expression.SemanticContext, invocation: FunctionInvocation): SemanticCheck = - invocation.function match { - case f:AggregatingFunction => - when(ctx == Expression.SemanticContext.Simple) { - error(s"Invalid use of aggregating function ${f.name}(...) in this context", invocation.position) - } chain { - SemanticExpressionCheck.check(ctx, invocation.arguments) chain - semanticCheck(ctx, invocation) - } - - case Reduce => - error(s"${Reduce.name}(...) requires '| expression' (an accumulation expression)", invocation.position) - - case f:Function => - when(invocation.distinct) { - error(s"Invalid use of DISTINCT with function '${f.name}'", invocation.position) - } chain SemanticExpressionCheck.check(ctx, invocation.arguments) chain semanticCheck(ctx, invocation) - } - - protected def semanticCheck(ctx: Expression.SemanticContext, invocation: FunctionInvocation): SemanticCheck = - invocation.function match { - case Coalesce => - checkMinArgs(invocation, 1) chain - expectType(CTAny.covariant, invocation.arguments) chain - specifyType(leastUpperBoundsOfTypes(invocation.arguments), invocation) - - case Collect => - checkArgs(invocation, 1) ifOkChain { - expectType(CTAny.covariant, invocation.arguments(0)) chain - specifyType(types(invocation.arguments(0))(_).wrapInList, invocation) - } - - case Exists => - checkArgs(invocation, 1) ifOkChain { - expectType(CTAny.covariant, invocation.arguments.head) chain - (invocation.arguments.head match { - case _: Property => None - case _: PatternExpression => None - case _: ContainerIndex => None - case e => - Some(SemanticError(s"Argument to ${invocation.name}(...) is not a property or pattern", e.position, invocation.position)) - }) - } chain specifyType(CTBoolean, invocation) - - case Head => - checkArgs(invocation, 1) ifOkChain { - expectType(CTList(CTAny).covariant, invocation.arguments.head) chain - specifyType(possibleTypes(invocation.arguments.head), invocation) - } - - case Last => - def possibleTypes(expression: Expression) : TypeGenerator = s => - (types(expression)(s) constrain CTList(CTAny)).unwrapLists - - checkArgs(invocation, 1) ifOkChain { - expectType(CTList(CTAny).covariant, invocation.arguments.head) chain - specifyType(possibleTypes(invocation.arguments.head), invocation) - } - - case Length => - def checkForInvalidUsage(ctx: SemanticContext, invocation: FunctionInvocation) = (originalState: SemanticState) => { - val newState = invocation.args.foldLeft(originalState) { - case (state, expr) if state.expressionType(expr).actual != CTPath.invariant => - state.addNotification(LengthOnNonPathNotification(expr.position)) - case (state, expr) => - state - } - - SemanticCheckResult(newState, Seq.empty) - } - checkTypeSignatures(ctx, Length, invocation) chain checkForInvalidUsage(ctx, invocation) - - case Max => - expectType(CTAny.covariant, invocation.arguments) chain - specifyType(leastUpperBoundsOfTypes(invocation.arguments), invocation) - - case Min => - expectType(CTAny.covariant, invocation.arguments) chain - specifyType(leastUpperBoundsOfTypes(invocation.arguments), invocation) - - case PercentileCont => - checkTypeSignatures(ctx, PercentileCont, invocation) ifOkChain - checkPercentileRange(invocation.args(1)) - - case PercentileDisc => - checkTypeSignatures(ctx, PercentileDisc, invocation) ifOkChain - checkPercentileRange(invocation.args(1)) - - case Point => - checkTypeSignatures(ctx, Point, invocation) ifOkChain - checkPointMap(invocation.args(0)) - - case Reverse => - checkArgs(invocation, 1) ifOkChain { - expectType(CTList(CTAny).covariant | CTString, invocation.arguments.head) chain - specifyType(types(invocation.arguments.head), invocation) - } - - case Tail => - checkArgs(invocation, 1) ifOkChain { - expectType(CTList(CTAny).covariant, invocation.arguments(0)) chain - specifyType(types(invocation.arguments(0)), invocation) - } - - case ToBoolean => - checkMinArgs(invocation, 1) ifOkChain - checkMaxArgs(invocation, 1) ifOkChain - checkToBooleanTypeOfArgument(invocation) ifOkChain - specifyType(CTBoolean, invocation) - - case UnresolvedFunction => - // We cannot do a full semantic check until we have resolved the function call. - SemanticCheckResult.success - - case x:TypeSignatures => - checkTypeSignatures(ctx, x, invocation) - } - - /** - * Check that invocation align with one of the functions type signatures - */ - def checkTypeSignatures( - ctx: Expression.SemanticContext, - f:TypeSignatures, - invocation: FunctionInvocation - ): SemanticCheck = - checkMinArgs(invocation, f.signatureLengths.min) chain - checkMaxArgs(invocation, f.signatureLengths.max) chain - checkTypes(invocation, f.signatures) - - protected def checkArgs(invocation: FunctionInvocation, n: Int): Option[SemanticError] = - Vector(checkMinArgs(invocation, n), checkMaxArgs(invocation, n)).flatten.headOption - - protected def checkMaxArgs(invocation: FunctionInvocation, n: Int): Option[SemanticError] = - if (invocation.arguments.length > n) - Some(SemanticError(s"Too many parameters for function '${invocation.function.name}'", invocation.position)) - else - None - - protected def checkMinArgs(invocation: FunctionInvocation, n: Int): Option[SemanticError] = - if (invocation.arguments.length < n) - Some(SemanticError(s"Insufficient parameters for function '${invocation.function.name}'", invocation.position)) - else - None - - - /* - * Checks so that the expression is in the range [min, max] - */ - def checkPercentileRange(expression: Expression): SemanticCheck = { - expression match { - case d: DoubleLiteral if d.value >= 0.0 && d.value <= 1.0 => - SemanticCheckResult.success - case i: IntegerLiteral if i.value == 0L || i.value == 1L => - SemanticCheckResult.success - case d: DoubleLiteral => - error(s"Invalid input '${d.value}' is not a valid argument, must be a number in the range 0.0 to 1.0", d.position) - - case l: Literal => - error(s"Invalid input '${ - l.asCanonicalStringVal - }' is not a valid argument, must be a number in the range 0.0 to 1.0", l.position) - - //for other types we'll have to wait until runtime to fail - case _ => SemanticCheckResult.success - - } - } - - /* - * Checks so that the point map is properly formatted - */ - protected def checkPointMap(expression: Expression): SemanticCheck = - expression match { - - //Cartesian point - case map: MapExpression if map.items.exists(withKey("x")) && map.items.exists(withKey("y")) => - SemanticCheckResult.success - - //Geographic point - case map: MapExpression if map.items.exists(withKey("longitude")) && map.items.exists(withKey("latitude")) => - SemanticCheckResult.success - - case map: MapExpression => error( - s"A map with keys ${map.items.map((a) => s"'${a._1.name}'").mkString(", ")} is not describing a valid point, " + - s"a point is described either by using cartesian coordinates e.g. {x: 2.3, y: 4.5, crs: 'cartesian'} or using " + - s"geographic coordinates e.g. {latitude: 12.78, longitude: 56.7, crs: 'WGS-84'}.", map.position) - - //if using variable or parameter we can't introspect the map here - case _ => SemanticCheckResult.success - } - - private def withKey(key: String)(kv: (PropertyKeyName, Expression)) = kv._1.name == key - - - private def checkToBooleanTypeOfArgument(invocation: FunctionInvocation): SemanticCheck = - (s: SemanticState) => { - val argument = invocation.args.head - val specifiedType = s.expressionType(argument).specified - val correctType = Seq(CTString, CTBoolean, CTAny).foldLeft(false) { - case (acc, t) => acc || specifiedType.contains(t) - } - - if (correctType) SemanticCheckResult.success(s) - else { - val msg = s"Type mismatch: expected Boolean or String but was ${specifiedType.mkString(", ")}" - error(msg, argument.position)(s) - } - } -} - diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticPatternCheck.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticPatternCheck.scala deleted file mode 100644 index 2a72145df8bba..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticPatternCheck.scala +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.symbols.{CTList, CTMap, CTNode, CTPath, CTRelationship} -import org.neo4j.cypher.internal.frontend.v3_5.SemanticCheck -import org.neo4j.cypher.internal.frontend.v3_5.notification.UnboundedShortestPathNotification -import org.neo4j.cypher.internal.v3_5.expressions.Pattern.SemanticContext.name -import org.neo4j.cypher.internal.v3_5.expressions.Pattern.{SemanticContext, findDuplicateRelationships} -import org.neo4j.cypher.internal.v3_5.expressions._ - -object SemanticPatternCheck extends SemanticAnalysisTooling { - - def check(ctx: SemanticContext, pattern:Pattern): SemanticCheck = - pattern match { - case x:Pattern => - semanticCheckFold(x.patternParts)(declareVariables(ctx)) chain - semanticCheckFold(x.patternParts)(check(ctx)) chain - ensureNoDuplicateRelationships(x, ctx) - } - - def check(ctx: SemanticContext, pattern:RelationshipsPattern): SemanticCheck = - declareVariables(ctx, pattern.element) chain - check(ctx, pattern.element) - - def declareVariables(ctx:SemanticContext)(part:PatternPart):SemanticCheck = - part match { - case x:NamedPatternPart => - declareVariables(ctx)(x.patternPart) chain - declareVariable(x.variable, CTPath) - - case x:EveryPath => - (x.element, ctx) match { - // single node variable is allowed to be already bound in MATCH and GRAPH OF - case (_: NodePattern, SemanticContext.GraphOf) => - declareVariables(ctx, x.element) - case (_: NodePattern, SemanticContext.Match) => - declareVariables(ctx, x.element) - case (n: NodePattern, _) => - n.variable.fold(SemanticCheckResult.success)(declareVariable(_, CTNode)) chain - declareVariables(ctx, n) - case _ => - declareVariables(ctx, x.element) - } - - case x:ShortestPaths => - declareVariables(ctx, x.element) - } - - def check(ctx: SemanticContext)(part:PatternPart):SemanticCheck = - part match { - case x:NamedPatternPart => - check(ctx)(x.patternPart) - - case x:EveryPath => - check(ctx, x.element) - - case x:ShortestPaths => - def checkContext: SemanticCheck = - ctx match { - case SemanticContext.Merge => - SemanticError(s"${ - x.name - }(...) cannot be used to MERGE", x.position, x.element.position) - case SemanticContext.Create | SemanticContext.CreateUnique => - SemanticError(s"${ - x.name - }(...) cannot be used to CREATE", x.position, x.element.position) - case _ => - None - } - - def checkContainsSingle: SemanticCheck = - x.element match { - case RelationshipChain(_: NodePattern, r, _: NodePattern) => - r.properties.map { - props => - SemanticError(s"${ - x.name - }(...) contains properties $props. This is currently not supported.", x.position, x.element.position) - } - case _ => - SemanticError(s"${ - x.name - }(...) requires a pattern containing a single relationship", x.position, x.element.position) - } - - def checkLength: SemanticCheck = - (state: SemanticState) => - x.element match { - case RelationshipChain(_, rel, _) => - rel.length match { - case Some(Some(Range(Some(min), _))) if min.value < 0 || min.value > 1 => - SemanticCheckResult(state, Seq(SemanticError(s"${ - x.name - }(...) does not support a minimal length different " + - s"from 0 or 1", x.position, x.element.position))) - - case Some(None) => - val newState = state.addNotification(UnboundedShortestPathNotification(x.element.position)) - SemanticCheckResult(newState, Seq.empty) - case _ => SemanticCheckResult(state, Seq.empty) - } - case _ => SemanticCheckResult(state, Seq.empty) - } - - def checkRelVariablesUnknown: SemanticCheck = - state => { - x.element match { - case RelationshipChain(_, rel, _) => - rel.variable.flatMap(id => state.symbol(id.name)) match { - case Some(symbol) if symbol.positions.size > 1 => { - SemanticCheckResult.error(state, SemanticError(s"Bound relationships not allowed in ${ - x.name - }(...)", rel.position, symbol.positions.head)) - } - case _ => - SemanticCheckResult.success(state) - } - case _ => - SemanticCheckResult.success(state) - } - } - - checkContext chain - checkContainsSingle chain - checkLength chain - checkRelVariablesUnknown chain - check(ctx, x.element) - } - - def check(ctx:SemanticContext, element:PatternElement):SemanticCheck = - element match { - case x:RelationshipChain => - check(ctx, x.element) chain - check(ctx, x.relationship) chain - check(ctx, x.rightNode) - - case x:InvalidNodePattern => - checkNodeProperties(ctx, x.properties) chain - error(s"Parentheses are required to identify nodes in patterns, i.e. (${x.id.name})", x.position) - - case x:NodePattern => - checkNodeProperties(ctx, x.properties) - - } - - def check(ctx:SemanticContext, x:RelationshipPattern):SemanticCheck = { - def checkNotUndirectedWhenCreating: SemanticCheck = { - ctx match { - case SemanticContext.Create | SemanticContext.GraphOf if x.direction == SemanticDirection.BOTH => - error(s"Only directed relationships are supported in ${name(ctx)}", x.position) - case _ => - SemanticCheckResult.success - } - } - - def checkNoVarLengthWhenUpdating: SemanticCheck = - when(!x.isSingleLength) { - ctx match { - case SemanticContext.Merge | - SemanticContext.Create | - SemanticContext.CreateUnique | - SemanticContext.GraphOf => - error(s"Variable length relationships cannot be used in ${name(ctx)}", x.position) - case _ => - None - } - } - - def checkProperties: SemanticCheck = - SemanticExpressionCheck.simple(x.properties) chain - expectType(CTMap.covariant, x.properties) - - checkNoVarLengthWhenUpdating chain - checkNoParamMapsWhenMatching(x.properties, ctx) chain - checkProperties chain - checkNotUndirectedWhenCreating - } - - def declareVariables(ctx:SemanticContext, element:PatternElement):SemanticCheck = - element match { - case x:RelationshipChain => - declareVariables(ctx, x.element) chain - declareVariables(ctx, x.relationship) chain - declareVariables(ctx, x.rightNode) - - case x:NodePattern => - x.variable.fold(SemanticCheckResult.success) { - variable => - ctx match { - case SemanticContext.Expression => - ensureDefined(variable) chain - expectType(CTNode.covariant, variable) - case _ => - implicitVariable(variable, CTNode) - } - } - } - - def declareVariables(ctx:SemanticContext, x:RelationshipPattern):SemanticCheck = - x.variable.fold(SemanticCheckResult.success) { - variable => - val possibleType = if (x.length.isEmpty) CTRelationship else CTList(CTRelationship) - - ctx match { - case SemanticContext.Match | SemanticContext.GraphOf => - implicitVariable(variable, possibleType) - case SemanticContext.Expression => - ensureDefined(variable) chain - expectType(possibleType.covariant, variable) - case _ => - declareVariable(variable, possibleType) - } - } - - private def ensureNoDuplicateRelationships(pattern: Pattern, ctx: SemanticContext): SemanticCheck = { - findDuplicateRelationships(pattern).foldLeft(SemanticCheckResult.success) { - (acc, duplicates) => - val id = duplicates.head - val dups = duplicates.tail - - acc chain SemanticError(s"Cannot use the same relationship variable '${id.name}' for multiple patterns", id.position, dups.map(_.position):_*) - } - } - - def checkNodeProperties(ctx: SemanticContext, properties: Option[Expression]): SemanticCheck = - checkNoParamMapsWhenMatching(properties, ctx) chain - SemanticExpressionCheck.simple(properties) chain - expectType(CTMap.covariant, properties) -} - -object checkNoParamMapsWhenMatching { - def apply(properties: Option[Expression], ctx: SemanticContext): SemanticCheck = (properties, ctx) match { - case (Some(e: Parameter), SemanticContext.Match) => - SemanticError("Parameter maps cannot be used in MATCH patterns (use a literal map instead, eg. \"{id: {param}.id}\")", e.position) - case (Some(e: Parameter), SemanticContext.Merge) => - SemanticError("Parameter maps cannot be used in MERGE patterns (use a literal map instead, eg. \"{id: {param}.id}\")", e.position) - case (Some(e: Parameter), SemanticContext.GraphOf) => - SemanticError("Parameter maps cannot be used in GRAPH OF patterns (use a literal map instead, eg. \"{id: {param}.id}\")", e.position) - case _ => - None - } -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticState.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticState.scala deleted file mode 100644 index 29775af2c43de..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticState.scala +++ /dev/null @@ -1,511 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.symbols.{CTGraphRef, CypherType, TypeSpec} -import org.neo4j.cypher.internal.util.v3_5.{ASTNode, InputPosition, InternalException, Ref} -import org.neo4j.cypher.internal.frontend.v3_5.SemanticCheck -import org.neo4j.cypher.internal.frontend.v3_5.ast.ASTAnnotationMap -import org.neo4j.cypher.internal.frontend.v3_5.helpers.{TreeElem, TreeZipper} -import org.neo4j.cypher.internal.frontend.v3_5.notification.InternalNotification -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticState.ScopeLocation -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, LogicalVariable, Variable} - -import scala.collection.immutable.HashMap -import scala.language.postfixOps - -object SymbolUse { - def apply(variable:LogicalVariable):SymbolUse = SymbolUse(variable.name, variable.position) -} - -// A symbol use represents the occurrence of a symbol at a position -final case class SymbolUse(name: String, position: InputPosition) { - override def toString = s"SymbolUse($nameWithPosition)" - - def asVariable: Variable = Variable(name)(position) - def nameWithPosition = s"$name@${position.toOffsetString}" -} - -// A symbol collects all uses of a position within the current scope and -// up to the originally defining scope together with type information -// -// (s1 n1 (s2 ... (s3 n2 (s4 ... n3)) => -// -// s1.localSymbol(n) = Symbol(n, Seq(1), type(n)) -// s3.localSymbol(n) = Symbol(n, Seq(1, 2), type(n)) -// s4.localSymbol(n) = Symbol(n, Seq(1, 2, 3), type(n)) -// -final case class Symbol(name: String, positions: Set[InputPosition], - types: TypeSpec, - graph: Boolean = false, - generated: Boolean = false) { - if (positions.isEmpty) - throw new InternalException(s"Cannot create empty symbol with name '$name'") - - def uses: Set[SymbolUse] = positions.map { pos => SymbolUse(name, pos) } - - val definition = SymbolUse(name, positions.toSeq.min(InputPosition.byOffset)) - - def asGenerated: Symbol = copy(generated = true) - - def withMergedPositions(additionalPositions: Set[InputPosition]): Symbol = - copy(positions = positions ++ additionalPositions) - - override def toString: String = - if (graph) - s"GRAPH ${definition.nameWithPosition}(${positions.map(_.offset).mkString(",")})" - else - s"${definition.nameWithPosition}(${positions.map(_.offset).mkString(",")}): ${types.toShortString}" -} - -final case class ExpressionTypeInfo(specified: TypeSpec, expected: Option[TypeSpec] = None) { - lazy val actualUnCoerced: TypeSpec = expected.fold(specified)(specified intersect) - lazy val actual: TypeSpec = expected.fold(specified)(specified intersectOrCoerce) - lazy val wasCoerced: Boolean = actualUnCoerced != actual - - def expect(types: TypeSpec): ExpressionTypeInfo = copy(expected = Some(types)) -} - -final case class ContextGraphs(source: String, target: String) { - - override def toString: String = s"$source >> $target" - - def format(allGraphs: Set[String]): String = { - val remainingGraphs = allGraphs -- graphs - if (remainingGraphs.isEmpty) toString else s"$toString, ${remainingGraphs.mkString(", ")}" - } - - def graphs = Set(source, target) - - def updated(newSource: Option[String]): ContextGraphs = - updated(newSource, newSource) - - def updated(newSource: Option[String], newTarget: Option[String]): ContextGraphs = - copy(source = newSource.getOrElse(source), target = newTarget.getOrElse(target)) -} - -object Scope { - val empty = Scope(symbolTable = HashMap.empty, children = Vector()) - - def withContext(newContextGraphs: Option[ContextGraphs]): Scope = newContextGraphs match { - case Some(_) => empty.copy(contextGraphs = newContextGraphs) - case _ => empty - } -} - -final case class Scope(symbolTable: Map[String, Symbol], - children: Seq[Scope], - contextGraphs: Option[ContextGraphs] = None -) extends TreeElem[Scope] { - - self => - - override def updateChildren(newChildren: Seq[Scope]): Scope = copy(children = newChildren) - - def isEmpty: Boolean = symbolTable.isEmpty - - def symbol(name: String): Option[Symbol] = symbolTable.get(name) - def symbolNames: Set[String] = symbolTable.keySet - - def variable(name: String): Option[Symbol] = symbolTable.get(name).filter(!_.graph) - def variableNames: Set[String] = selectSymbolNames(!_.graph) - - def graph(name: String): Option[Symbol] = symbolTable.get(name).filter(_.graph) - def graphNames: Set[String] = selectSymbolNames(_.graph) - - def selectSymbolNames(f: Symbol => Boolean): Set[String] = symbolTable.collect { - case ((k, symbol)) if f(symbol) => k - }.toSet - - def valueSymbolTable: Map[String, Symbol] = symbolTable.collect { case entry if !entry._2.graph => entry } - def graphSymbolTable: Map[String, Symbol] = symbolTable.collect { case entry if entry._2.graph => entry } - - def importValuesFromScope(other: Scope, exclude: Set[String] = Set.empty): Scope = { - val otherSymbols = other.valueSymbolTable -- exclude - copy(symbolTable = symbolTable ++ otherSymbols) - } - - def importGraphsFromScope(other: Scope, exclude: Set[String] = Set.empty): Scope = { - val otherSymbols = other.graphSymbolTable -- exclude - copy(symbolTable = symbolTable ++ otherSymbols) - } - - def markAsGenerated(variable: String): Scope = - symbolTable - .get(variable) - .map(_.asGenerated) - .map(symbol => copy(symbolTable = symbolTable.updated(variable, symbol))) - .getOrElse(this) - - def removeContextGraphs(): Scope = - copy(contextGraphs = None) - - def updateContextGraphs(initialContextGraphs: ContextGraphs): Scope = - copy(contextGraphs = Some(initialContextGraphs)) - - def updateGraphVariable(variable: String, positions: Set[InputPosition], generated: Boolean = false): Scope = - copy( - symbolTable = symbolTable.updated( - variable, - Symbol(variable, positions, CTGraphRef, graph = true, generated = generated) - )) - - def updateVariable(variable: String, types: TypeSpec, positions: Set[InputPosition]): Scope = - copy(symbolTable = symbolTable.updated(variable, Symbol(variable, positions, types))) - - def mergePositions(variable: String, positions: Set[InputPosition]): Scope = - symbolTable.get(variable) match { - case Some(symbol) => copy(symbolTable = symbolTable.updated(variable, symbol.withMergedPositions(positions))) - case None => self - } - - def allSymbolDefinitions: Map[String, Set[SymbolUse]] = { - val allScopes1 = allScopes - allScopes1.foldLeft(Map.empty[String, Set[SymbolUse]]) { - case (acc0, scope) => - scope.symbolDefinitions.foldLeft(acc0) { - case (acc, symDef) if acc.contains(symDef.name) => - acc.updated(symDef.name, acc(symDef.name) + symDef) - case (acc, symDef) => - acc.updated(symDef.name, Set(symDef)) - } - } - } - - def symbolDefinitions: Set[SymbolUse] = - symbolTable.values.map(_.definition).toSet - - def allVariableDefinitions: Map[SymbolUse, SymbolUse] = - allScopes.map(_.variableDefinitions).reduce(_ ++ _) - - def variableDefinitions: Map[SymbolUse, SymbolUse] = - symbolTable.values.flatMap { symbol => - val name = symbol.name - val definition = symbol.definition - symbol.positions.map { pos => SymbolUse(name, pos) -> definition } - }.toMap - - def allScopes: Seq[Scope] = - Seq(this) ++ children.flatMap(_.allScopes) - - def toIdString = s"#${Ref(self).toIdString}" - - override def toString: String = - format(includeId = true) - - def toStringWithoutId: String = - format(includeId = false) - - private def format(includeId: Boolean): String = { - val builder = new StringBuilder() - self.dumpSingle("", includeId, builder) - builder.toString() - } - - import scala.compat.Platform.EOL - - private def dumpSingle(indent: String, includeId: Boolean, builder: StringBuilder): Unit = { - val contextGraphsInScope = contextGraphs.map(_.toString).map(" /* " ++ _ ++ " */").getOrElse("") - if (includeId) builder.append(s"$indent${self.toIdString} {$contextGraphsInScope$EOL") - else builder.append(s"$indent{$contextGraphsInScope$EOL") - dumpTree(s" $indent", includeId, builder) - builder.append(s"$indent}$EOL") - } - - private def dumpTree(indent: String, includeId: Boolean, builder: StringBuilder): Unit = { - symbolTable.keys.toSeq.sorted.foreach { key => - val symbol = symbolTable(key) - val generatedText = if (symbol.generated) " (generated)" else "" - val keyText = if (symbol.graph) s"GRAPH $key$generatedText" else s"$key$generatedText" - val symbolText = symbol.positions.map(_.toOffsetString).toSeq.sorted.mkString(" ") - builder.append(s"$indent$keyText: $symbolText$EOL") - } - children.foreach { child => child.dumpSingle(indent, includeId, builder) } - } -} - -object SemanticState { - implicit object ScopeZipper extends TreeZipper[Scope] - - def withStartingVariables(variables: (String, CypherType)*) = - SemanticState( - Scope.empty.copy(variables.toMap.map { - case (name, t) => - name -> Symbol(name, Set(InputPosition.NONE), TypeSpec.exact(t)) - }).location, - ASTAnnotationMap.empty, - ASTAnnotationMap.empty - ) - - val clean = SemanticState(Scope.empty.location, ASTAnnotationMap.empty, ASTAnnotationMap.empty) - - implicit class ScopeLocation(val location: ScopeZipper.Location) extends AnyVal { - def scope: Scope = location.elem - def rootScope: Scope = location.root.elem - def parent: Option[ScopeLocation] = location.up.map(ScopeLocation) - - def newChildScope: ScopeLocation = location.insertChild(Scope.empty) - def newSiblingScope: ScopeLocation = location.insertRight(Scope.empty).get - - def isEmpty: Boolean = scope.isEmpty - - def localSymbol(name: String): Option[Symbol] = scope.symbol(name) - def symbol(name: String): Option[Symbol] = localSymbol(name) orElse location.up.flatMap(_.symbol(name)) - def symbolNames: Set[String] = scope.symbolNames - - def localVariable(name: String): Option[Symbol] = scope.variable(name) - def variable(name: String): Option[Symbol] = localVariable(name) orElse location.up.flatMap(_.variable(name)) - def variableNames: Set[String] = scope.variableNames - - def localGraph(name: String): Option[Symbol] = scope.graph(name) - def graph(name: String): Option[Symbol] = localGraph(name) orElse location.up.flatMap(_.graph(name)) - def graphNames: Set[String] = scope.graphNames - - def localContextGraphs: Option[ContextGraphs] = scope.contextGraphs - def contextGraphs: Option[ContextGraphs] = localContextGraphs orElse location.up.flatMap(_.contextGraphs) - - def sourceGraph: Option[Symbol] = contextGraphs.map(_.source).flatMap(graph) - def targetGraph: Option[Symbol] = contextGraphs.map(_.target).flatMap(graph) - - def importValuesFromScope(other: Scope, exclude: Set[String] = Set.empty): ScopeLocation = - location.replace(scope.importValuesFromScope(other, exclude)) - - def importGraphsFromScope(other: Scope, exclude: Set[String] = Set.empty): ScopeLocation = - location.replace(scope.importGraphsFromScope(other, exclude)) - - def localMarkAsGenerated(name: String): ScopeLocation = - location.replace(scope.markAsGenerated(name)) - - def mergeSymbolPositionsFromScope(other: Scope, exclude: Set[String] = Set.empty): ScopeLocation = - other.symbolTable.values.foldLeft(location) { - case (loc, sym) if exclude(sym.name) => loc - case (loc, sym) => loc.replace(loc.scope.mergePositions(sym.name, sym.positions)) - } - - def removeContextGraphs(): ScopeLocation = - location.replace(scope.removeContextGraphs()) - - def updateContextGraphs(newContextGraphs: ContextGraphs): ScopeLocation = - location.replace(scope.updateContextGraphs(newContextGraphs)) - - def updateGraph(variable: String, positions: Set[InputPosition], generated: Boolean = false): ScopeLocation = - location.replace(scope.updateGraphVariable(variable, positions, generated)) - - def updateVariable(variable: String, types: TypeSpec, positions: Set[InputPosition]): ScopeLocation = - location.replace(scope.updateVariable(variable, types, positions)) - - def mergePositions(variable: String, positions: Set[InputPosition]): ScopeLocation = - location.replace(scope.mergePositions(variable, positions)) - } - - def recordCurrentScope(node:ASTNode): SemanticCheck = - recordCurrentScopeOnly(node) chain recordCurrentContextGraphsOnly(node) - - def recordCurrentScopeOnly(node:ASTNode): SemanticCheck = - s => SemanticCheckResult.success(s.recordCurrentScope(node)) - - def recordCurrentContextGraphsOnly(node:ASTNode): SemanticCheck = - s => SemanticCheckResult.success(s.recordCurrentContextGraphs(node)) -} - -case class SemanticState(currentScope: ScopeLocation, - typeTable: ASTAnnotationMap[Expression, ExpressionTypeInfo], - recordedScopes: ASTAnnotationMap[ASTNode, Scope], - recordedContextGraphs: ASTAnnotationMap[ASTNode, ContextGraphs] = ASTAnnotationMap.empty, - notifications: Set[InternalNotification] = Set.empty, - features: Set[SemanticFeature] = Set.empty, - initialWith: Boolean = false - ) { - - def recogniseInitialWith: SemanticState = copy(initialWith = true) - def clearInitialWith: SemanticState = if (initialWith) copy(initialWith = false) else this - - def scopeTree: Scope = currentScope.rootScope - - def newChildScope: SemanticState = copy(currentScope = currentScope.newChildScope) - def newSiblingScope: SemanticState = copy(currentScope = currentScope.newSiblingScope) - def popScope: SemanticState = copy(currentScope = currentScope.parent.get) - - def symbol(name: String): Option[Symbol] = currentScope.symbol(name) - def variable(name: String): Option[Symbol] = currentScope.variable(name) - def graph(name: String): Option[Symbol] = currentScope.graph(name) - - def symbolTypes(name: String): TypeSpec = symbol(name).map(_.types).getOrElse(TypeSpec.all) - - def importValuesFromScope(scope: Scope, exclude: Set[String] = Set.empty): SemanticState = - copy(currentScope = currentScope.importValuesFromScope(scope, exclude)) - - def importGraphsFromScope(scope: Scope, exclude: Set[String] = Set.empty): SemanticState = - copy(currentScope = currentScope.importGraphsFromScope(scope, exclude)) - - def mergeSymbolPositionsFromScope(scope: Scope, exclude: Set[String] = Set.empty): SemanticState = - copy(currentScope = currentScope.mergeSymbolPositionsFromScope(scope, exclude)) - - def updateContextGraphs(newContextGraphs: ContextGraphs): Either[SemanticError, SemanticState] = { - val newScope = currentScope.updateContextGraphs(newContextGraphs) - if (newScope.sourceGraph.isEmpty) - Left(SemanticError("No source graph is available in scope", InputPosition.NONE)) - else if (newScope.targetGraph.isEmpty) - Left(SemanticError("No target graph is available in scope", InputPosition.NONE)) - else - Right(copy(currentScope = newScope)) - } - - def removeContextGraphs(): Either[SemanticError, SemanticState] = { - val newScope = currentScope.removeContextGraphs() - Right(copy(currentScope = newScope)) - } - - def localMarkAsGenerated(variable: Variable): Either[SemanticError, SemanticState] = - currentScope.localSymbol(variable.name) match { - case None => - Left(SemanticError(s"`${variable.name}` cannot be marked as generated - it has not been declared in the local scope", variable.position)) - case Some(symbol) => - Right(copy(currentScope = currentScope.localMarkAsGenerated(symbol.name))) - } - - def declareGraph(variable: Variable, positions: Set[InputPosition] = Set.empty): Either[SemanticError, SemanticState] = - currentScope.localSymbol(variable.name) match { - case None => - Right(updateGraph(variable, positions + variable.position)) - case Some(symbol) if symbol.graph => - Left(SemanticError(s"Graph `${variable.name}` already declared", variable.position, symbol.positions.toSeq: _*)) - case Some(symbol) => - Left(SemanticError(s"`${variable.name}` already declared as variable", variable.position, symbol.positions.toSeq: _*)) - } - - def declareVariable(variable: LogicalVariable, possibleTypes: TypeSpec, positions: Set[InputPosition] = Set.empty): Either[SemanticError, SemanticState] = - currentScope.localSymbol(variable.name) match { - case None => - Right(updateVariable(variable, possibleTypes, positions + variable.position)) - case Some(symbol) if symbol.graph => - Left(SemanticError(s"`${variable.name}` already declared as graph", variable.position, symbol.positions.toSeq: _*)) - case Some(symbol) => - Left(SemanticError(s"Variable `${variable.name}` already declared", variable.position, symbol.positions.toSeq: _*)) - } - - def addNotification(notification: InternalNotification): SemanticState = - copy(notifications = notifications + notification) - - def implicitContextGraph(variable: Option[String], position: InputPosition, contextGraphName: String) - : Either[SemanticError, SemanticState] = - variable match { - case Some(name) => implicitGraph(Variable(name)(position)) - case None => Left(SemanticError(s"No $contextGraphName in scope", position)) - } - - def implicitGraph(variable: Variable): Either[SemanticError, SemanticState] = - this.symbol(variable.name) match { - case None => - Right(updateGraph(variable, Set(variable.position))) - case Some(symbol) if symbol.graph => - Right(updateGraph(variable, symbol.positions + variable.position, symbol.generated)) - case Some(symbol) => - Left(SemanticError(s"`${variable.name}` already declared as variable", variable.position, symbol.positions.toSeq: _*)) - } - - def implicitVariable(variable: LogicalVariable, possibleTypes: TypeSpec): Either[SemanticError, SemanticState] = - this.symbol(variable.name) match { - case None => - Right(updateVariable(variable, possibleTypes, Set(variable.position))) - case Some(symbol) if symbol.graph => - Left(SemanticError(s"`${variable.name}` already declared as graph", variable.position, symbol.positions.toSeq: _*)) - case Some(symbol) => - val inferredTypes = symbol.types intersect possibleTypes - if (inferredTypes.nonEmpty) { - Right(updateVariable(variable, inferredTypes, symbol.positions + variable.position)) - } else { - val existingTypes = symbol.types.mkString(", ", " or ") - val expectedTypes = possibleTypes.mkString(", ", " or ") - Left(SemanticError( - s"Type mismatch: ${variable.name} already defined with conflicting type $existingTypes (expected $expectedTypes)", - variable.position, symbol.positions.toSeq: _*)) - } - } - - def ensureVariableDefined(variable: LogicalVariable): Either[SemanticError, SemanticState] = - this.symbol(variable.name) match { - case None => - Left(SemanticError(s"Variable `${variable.name}` not defined", variable.position)) - case Some(symbol) if symbol.graph => - Left(SemanticError(s"`${variable.name}` already declared as graph", variable.position, symbol.positions.toSeq: _*)) - case Some(symbol) => - Right(updateVariable(variable, symbol.types, symbol.positions + variable.position)) - } - - def ensureGraphDefined(variable: Variable): Either[SemanticError, SemanticState] = - this.symbol(variable.name) match { - case None if initialWith => - Right(updateGraph(variable, Set(variable.position))) - case None => - Left(SemanticError(s"Variable `${variable.name}` not defined", variable.position)) - case Some(symbol) if symbol.graph => - Right(updateGraph(variable, symbol.positions + variable.position)) - case Some(symbol) => - Left(SemanticError(s"`${variable.name}` already declared as variable", variable.position, symbol.positions.toSeq: _*)) - } - - def specifyType(expression: Expression, possibleTypes: TypeSpec): Either[SemanticError, SemanticState] = - expression match { - case variable: Variable => - implicitVariable(variable, possibleTypes) - case _ => - Right(copy(typeTable = typeTable.updated(expression, ExpressionTypeInfo(possibleTypes)))) - } - - def expectType(expression: Expression, possibleTypes: TypeSpec): (SemanticState, TypeSpec) = { - val expType = expressionType(expression) - val updated = expType.expect(possibleTypes) - (copy(typeTable = typeTable.updated(expression, updated)), updated.actual) - } - - def withFeatures(features: SemanticFeature*): SemanticState = - features.foldLeft(this)(_.withFeature(_)) - - def expressionType(expression: Expression): ExpressionTypeInfo = typeTable.getOrElse(expression, ExpressionTypeInfo(TypeSpec.all)) - - private def updateGraph(variable: LogicalVariable, locations: Set[InputPosition], generated: Boolean = false) = - copy( - currentScope = currentScope.updateGraph(variable.name, locations, generated), - typeTable = typeTable.updated(variable, ExpressionTypeInfo(CTGraphRef)) - ) - - private def updateVariable(variable: LogicalVariable, types: TypeSpec, locations: Set[InputPosition]) = - copy( - currentScope = currentScope.updateVariable(variable.name, types, locations), - typeTable = typeTable.updated(variable, ExpressionTypeInfo(types)) - ) - - def recordCurrentScope(astNode: ASTNode): SemanticState = - copy(recordedScopes = recordedScopes.updated(astNode, currentScope.scope)) - - def recordCurrentContextGraphs(astNode: ASTNode): SemanticState = { - val optCurrentContextGraphs = currentScope.contextGraphs - optCurrentContextGraphs.map(recordedContextGraphs.updated(astNode, _)) match { - case Some(newRecordedContextGraphs) => copy(recordedContextGraphs = newRecordedContextGraphs) - case None => this - } - } - - def scope(astNode: ASTNode): Option[Scope] = - recordedScopes.get(astNode) - - def contextGraphs(astNode: ASTNode): Option[ContextGraphs] = - recordedContextGraphs.get(astNode) - - def withFeature(feature: SemanticFeature): SemanticState = copy(features = features + feature) -} diff --git a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticTable.scala b/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticTable.scala deleted file mode 100644 index 0ede3acbe93f9..0000000000000 --- a/community/cypher/frontend-3.5/src/main/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticTable.scala +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.ASTAnnotationMap -import org.neo4j.cypher.internal.v3_5.expressions._ - -import scala.collection.mutable - -object SemanticTable { - def apply(types: ASTAnnotationMap[Expression, ExpressionTypeInfo] = ASTAnnotationMap.empty, - recordedScopes: ASTAnnotationMap[ASTNode, Scope] = ASTAnnotationMap.empty) = - new SemanticTable(types, recordedScopes) -} - -class SemanticTable( - val types: ASTAnnotationMap[Expression, ExpressionTypeInfo] = ASTAnnotationMap.empty, - val recordedScopes: ASTAnnotationMap[ASTNode, Scope] = ASTAnnotationMap.empty, - val resolvedLabelNames: mutable.Map[String, LabelId] = new mutable.HashMap[String, LabelId], - val resolvedPropertyKeyNames: mutable.Map[String, PropertyKeyId] = new mutable.HashMap[String, PropertyKeyId], - val resolvedRelTypeNames: mutable.Map[String, RelTypeId] = new mutable.HashMap[String, RelTypeId] - ) extends Cloneable { - - def getTypeFor(s: String): TypeSpec = try { - val reducedType = types.collect { - case (Variable(name), typ) if name == s => typ.specified - }.reduce(_ & _) - - if (reducedType.isEmpty) - throw new InternalException(s"This semantic table contains conflicting type information for variable $s") - - reducedType - } catch { - case e: UnsupportedOperationException => - throw new InternalException(s"Did not find any type information for variable $s", e) - } - - def getActualTypeFor(expr: Expression): TypeSpec = - types.getOrElse(expr, throw new InternalException(s"Did not find any type information for expression $expr")).actual - - def containsNode(expr: String): Boolean = types.exists { - case (v@Variable(name), _) => name == expr && isNode(v) // NOTE: Profiling showed that checking node type last is better - case _ => false - } - - def id(labelName:LabelName):Option[LabelId] = resolvedLabelNames.get(labelName.name) - - def id(propertyKeyName:PropertyKeyName):Option[PropertyKeyId] = resolvedPropertyKeyNames.get(propertyKeyName.name) - - def id(resolvedRelTypeName:RelTypeName):Option[RelTypeId] = resolvedRelTypeNames.get(resolvedRelTypeName.name) - - def seen(expression: Expression) = types.contains(expression) - - def isNode(expr: String) = getTypeFor(expr) == CTNode.invariant - - def isRelationship(expr: String) = getTypeFor(expr) == CTRelationship.invariant - - def isRelationshipCollection(expr: String) = getTypeFor(expr) == CTList(CTRelationship).invariant - - def isNodeCollection(expr: String) = getTypeFor(expr) == CTList(CTNode).invariant - - def isNode(expr: LogicalVariable) = types(expr).specified == CTNode.invariant - - def isRelationship(expr: LogicalVariable) = types(expr).specified == CTRelationship.invariant - - def addNode(expr: Variable) = - copy(types = types.updated(expr, ExpressionTypeInfo(CTNode.invariant, None))) - - def addRelationship(expr: Variable) = - copy(types = types.updated(expr, ExpressionTypeInfo(CTRelationship.invariant, None))) - - def replaceExpressions(rewriter: Rewriter): SemanticTable = { - val replacements = types.keys.toIndexedSeq.map { keyExpression => - keyExpression -> keyExpression.endoRewrite(rewriter) - } - copy(types = types.replaceKeys(replacements: _*), recordedScopes = recordedScopes.replaceKeys(replacements: _*)) - } - - def replaceNodes(replacements: (ASTNode, ASTNode)*): SemanticTable = - copy(recordedScopes = recordedScopes.replaceKeys(replacements: _*)) - - def symbolDefinition(variable: Variable) = - recordedScopes(variable).symbolTable(variable.name).definition - - override def clone() = copy() - - def copy( - types: ASTAnnotationMap[Expression, ExpressionTypeInfo] = types, - recordedScopes: ASTAnnotationMap[ASTNode, Scope] = recordedScopes, - resolvedLabelIds: mutable.Map[String, LabelId] = resolvedLabelNames, - resolvedPropertyKeyNames: mutable.Map[String, PropertyKeyId] = resolvedPropertyKeyNames, - resolvedRelTypeNames: mutable.Map[String, RelTypeId] = resolvedRelTypeNames - ) = - new SemanticTable(types, recordedScopes, resolvedLabelIds.clone(), resolvedPropertyKeyNames.clone(), resolvedRelTypeNames.clone()) -} - diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/FoldableTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/FoldableTest.scala deleted file mode 100644 index ed861865aa8c9..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/FoldableTest.scala +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5 - -import org.neo4j.cypher.internal.util.v3_5.Foldable -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite - -object FoldableTest { - trait Exp extends Foldable - case class Val(int: Int) extends Exp - case class Add(lhs: Exp, rhs: Exp) extends Exp - case class Sum(args: Seq[Exp]) extends Exp -} - -class FoldableTest extends CypherFunSuite { - import FoldableTest._ - - test("should fold value depth first over object tree") { - val ast = Add(Val(55), Add(Val(43), Val(52))) - - val result = ast.fold(50) { - case Val(x) => acc => acc + x - } - - assert(result === 200) - } - - test("should fold by depth then breadth left to right") { - val ast = Add(Val(1), Add(Add(Val(2), Val(3)), Val(4))) - - val result = ast.fold(Seq.empty[Int]) { - case Val(x) => acc => acc :+ x - } - - assert(result === Seq(1, 2, 3, 4)) - } - - test("should tree fold over all objects") { - val ast = Add(Val(55), Add(Val(43), Val(52))) - - val result = ast.treeFold(50) { - case Val(x) => acc => (acc + x, Some(identity)) - } - - assert(result === 200) - } - - test("should be able to stop-recursion in tree fold") { - val ast = Add(Val(55), Add(Val(43), Val(52))) - - val result = ast.treeFold(50) { - case Val(x) => acc => (acc + x, Some(identity)) - case Add(Val(43), _) => acc => (acc + 20, None) - } - - assert(result === 125) - } - - test("should allow using exist to find patterns deeply nested") { - val ast = Add(Val(1), Add(Val(2), Val(3))) - - ast.treeExists { - case Val(x) => x == 2 - } should equal(true) - - ast.treeExists { - case Val(x) => x == 42 - } should equal(false) - } - -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/RepeatTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/RepeatTest.scala deleted file mode 100644 index f7a11d31b4662..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/RepeatTest.scala +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5 - -import org.neo4j.cypher.internal.util.v3_5.Rewriter -import org.neo4j.cypher.internal.frontend.v3_5.helpers.fixedPoint -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite - -class RepeatTest extends CypherFunSuite { - - var count = 0 - val result = new Object - val mockedRewriter = new Rewriter { - def apply(v1: AnyRef): AnyRef = { - count += 1 - result - } - } - - test("should not repeat when the output is the same of the input") { - // given - count = 0 - - // when - val output = fixedPoint(mockedRewriter)(result) - - // then - output should equal(result) - count should equal(1) - } - - test("should repeat once when the output is different from the input") { - // given - count = 0 - - // when - val output = fixedPoint(mockedRewriter)(new Object) - - // then - output should equal(result) - count should equal(2) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/SemanticAnalysisTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/SemanticAnalysisTest.scala deleted file mode 100644 index 2ab0398b67e46..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/SemanticAnalysisTest.scala +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5 - -import org.neo4j.cypher.internal.frontend.v3_5.ast.AstConstructionTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.phases._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticErrorDef -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite - -class SemanticAnalysisTest extends CypherFunSuite with AstConstructionTestSupport { - - // This test invokes SemanticAnalysis twice because that's what the production pipeline does - val pipeline = Parsing andThen SemanticAnalysis(warn = true) andThen SemanticAnalysis(warn = false) - - test("can inject starting semantic state") { - val query = "RETURN name AS name" - val startState = initStartState(query, Map("name" -> CTString)) - - pipeline.transform(startState, ErrorCollectingContext) - - ErrorCollectingContext.errors shouldBe empty - } - - test("can inject starting semantic state for larger query") { - val query = "MATCH (n:Label {name: name}) WHERE n.age > age RETURN n.name AS name" - - val startState = initStartState(query, Map("name" -> CTString, "age" -> CTInteger)) - - pipeline.transform(startState, ErrorCollectingContext) - - ErrorCollectingContext.errors shouldBe empty - } - - private def initStartState(query: String, initialFields: Map[String, CypherType]) = - InitialState(query, None, NoPlannerName, initialFields) -} - -object ErrorCollectingContext extends BaseContext { - - var errors: Seq[SemanticErrorDef] = Seq.empty - - override def tracer = CompilationPhaseTracer.NO_TRACING - override def notificationLogger = devNullLogger - override def exceptionCreator = ??? - override def monitors = ??? - override def errorHandler = (errs: Seq[SemanticErrorDef]) => - errors = errs -} - -object NoPlannerName extends PlannerName { - override def name = "no planner" - override def toTextOutput = "no planner" - override def version = "no version" -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ASTNodeTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ASTNodeTest.scala deleted file mode 100644 index dd1c99c62ab4a..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ASTNodeTest.scala +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite - -class ASTNodeTest extends CypherFunSuite { - - trait Exp extends ASTNode { - val position = DummyPosition(0) - } - - case class Val(int: Int) extends Exp - case class Add(lhs: Exp, rhs: Exp) extends Exp - - test("rewrite should match and replace expressions") { - val ast = Add(Val(1), Add(Val(2), Val(3))) - - val result = ast.rewrite(bottomUp(Rewriter.lift { - case Add(Val(x), Val(y)) => - Val(x + y) - })) - - assert(result === Val(6)) - } - - test("rewrite should match and replace primitives and expressions") { - val ast = Add(Val(1), Add(Val(2), Val(3))) - - val result = ast.rewrite(bottomUp(Rewriter.lift { - case Val(i) => - Val(i * i) - case Add(Val(x), Val(y)) => - Val(x + y) - })) - - assert(result === Val(14)) - } - - test("rewrite should duplicate ASTNode carrying InputPosition") { - case class AddWithPos(lhs: Exp, rhs: Exp)(override val position: InputPosition) extends Exp - - val ast = Add(Val(1), AddWithPos(Val(2), Val(3))(DummyPosition(0))) - - val result = ast.rewrite(topDown(Rewriter.lift { - case Val(_) => Val(99) - })) - - assert(result === Add(Val(99), AddWithPos(Val(99), Val(99))(DummyPosition(0)))) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/AstConstructionTestSupport.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/AstConstructionTestSupport.scala deleted file mode 100644 index b7fbeef58534f..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/AstConstructionTestSupport.scala +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.{DummyPosition, InputPosition} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherTestSupport -import org.neo4j.cypher.internal.v3_5.expressions._ - -import scala.language.implicitConversions - -trait AstConstructionTestSupport extends CypherTestSupport { - protected val pos = DummyPosition(0) - - implicit def withPos[T](expr: InputPosition => T): T = expr(pos) - - def varFor(name: String): Variable = Variable(name)(pos) - - def lblName(s: String) = LabelName(s)(pos) - - def hasLabels(v: String, label: String) = - HasLabels(varFor(v), Seq(lblName(label)))(pos) - - def prop(variable: String, propKey: String) = Property(varFor(variable), PropertyKeyName(propKey)(pos))(pos) - - def propEquality(variable: String, propKey: String, intValue: Int) = - Equals(prop(variable, propKey), literalInt(intValue))(pos) - - def propLessThan(variable: String, propKey: String, intValue: Int) = - LessThan(prop(variable, propKey), literalInt(intValue))(pos) - - def literalInt(intValue: Int): SignedDecimalIntegerLiteral = - SignedDecimalIntegerLiteral(intValue.toString)(pos) - - def literalFloat(floatValue: Double): DecimalDoubleLiteral = - DecimalDoubleLiteral(floatValue.toString)(pos) - - def literalList(expressions: Expression*): ListLiteral = - ListLiteral(expressions.toSeq)(pos) - - def literalIntList(intValues: Int*): ListLiteral = - ListLiteral(intValues.toSeq.map(literalInt))(pos) - - def literalFloatList(floatValues: Double*): ListLiteral = - ListLiteral(floatValues.toSeq.map(literalFloat))(pos) - - def literalIntMap(keyValues: (String, Int)*): MapExpression = - MapExpression(keyValues.map { - case (k, v) => (PropertyKeyName(k)(pos), SignedDecimalIntegerLiteral(v.toString)(pos)) - })(pos) - - def listOf(expressions: Expression*): ListLiteral = ListLiteral(expressions)(pos) - - def TRUE: Expression = True()(pos) - - def url(addr: String): GraphUrl = - GraphUrl(Right(StringLiteral(addr)(pos)))(pos) - - def graph(name: String): BoundGraphAs = - GraphAs(varFor(name), None)(pos) - - def graphAs(name: String, alias: String): BoundGraphAs = - GraphAs(varFor(name), Some(varFor(alias)))(pos) - - def graphAt(name: String, address: String): SingleGraphAs = - GraphAtAs(url(address), Some(varFor(name)))(pos) -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ConnectedComponentsTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ConnectedComponentsTest.scala deleted file mode 100644 index 20512a6f5c47c..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ConnectedComponentsTest.scala +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.{LogicalVariable, Variable} - -class ConnectedComponentsTest extends CypherFunSuite { - import connectedComponents._ - - test("(a)->(b), (c)->(d) has two connected components") { - val disconnected = connectedComponents(Vector( - ComponentPart(varFor("a"), varFor("b")), - ComponentPart(varFor("c"), varFor("d")))) - - disconnected should equal(Vector( - ConnectedComponent(ComponentPart(varFor("a"), varFor("b"))), - ConnectedComponent(ComponentPart(varFor("c"), varFor("d"))) - )) - } - - test("(a)->(b)->(c) does contain one connected component") { - val disconnected = connectedComponents(Vector( - ComponentPart(varFor("a"), varFor("b")), - ComponentPart(varFor("b"), varFor("c")))) - - disconnected should equal(Vector( - ConnectedComponent(ComponentPart(varFor("a"), varFor("b")), - ComponentPart(varFor("b"), varFor("c"))))) - } - - test("(a)->(b)->(c)->(d) does only contain one component") { - val disconnected = connectedComponents(Vector( - ComponentPart(varFor("a"), varFor("b")), - ComponentPart(varFor("b"), varFor("c")), - ComponentPart(varFor("c"), varFor("d")) - )) - - disconnected shouldBe Vector(ConnectedComponent( - ComponentPart(varFor("a"), varFor("b")), - ComponentPart(varFor("b"), varFor("c")), - ComponentPart(varFor("c"), varFor("d"))) - ) - } - - test("(a)->(b)->(c)-(a) contains one component ") { - val disconnected = connectedComponents(Vector - ( - ComponentPart(varFor("a"), varFor("b")), - ComponentPart(varFor("b"), varFor("c")), - ComponentPart(varFor("c"), varFor("a")) - )) - - disconnected shouldBe Vector(ConnectedComponent( - ComponentPart(varFor("a"), varFor("b")), - ComponentPart(varFor("b"), varFor("c")), - ComponentPart(varFor("c"), varFor("a")) - )) - } - - private def varFor(name: String): LogicalVariable = Variable(name)(null) -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ConstantExpressionTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ConstantExpressionTest.scala deleted file mode 100644 index 36e878a05519e..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ConstantExpressionTest.scala +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ - -class ConstantExpressionTest extends CypherFunSuite { - test("tests") { - assertIsConstant(SignedDecimalIntegerLiteral("42")(null)) - assertIsConstant(Parameter("42", CTAny)(null)) - assertIsConstant(ListLiteral(Seq(SignedDecimalIntegerLiteral("42")(null)))(null)) - } - - private def assertIsConstant(e: Expression) = { - val unapply = ConstantExpression.unapply(e) - if (unapply.isEmpty) fail(s"$e should be considered constant") - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ContainsAggregateTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ContainsAggregateTest.scala deleted file mode 100644 index ea81b66435ae5..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ContainsAggregateTest.scala +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ - -class ContainsAggregateTest extends CypherFunSuite with AstConstructionTestSupport { - - test("finds nested aggregate expressions") { - val expr: Expression = Add(SignedDecimalIntegerLiteral("1")_, CountStar()_)_ - - containsAggregate(expr) should equal(true) - } - - test("does not match non-aggregate expressions") { - val expr: Expression = Add(SignedDecimalIntegerLiteral("1")_, SignedDecimalIntegerLiteral("2")_)_ - - containsAggregate(expr) should equal(false) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ExpressionCallTypeCheckerTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ExpressionCallTypeCheckerTest.scala deleted file mode 100644 index fbc646bed7b5f..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ExpressionCallTypeCheckerTest.scala +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticCheckResult, SemanticExpressionCheck, SemanticState} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{DummyExpression, Expression, TypeSignature} - -class ExpressionCallTypeCheckerTest extends CypherFunSuite with AstConstructionTestSupport { - - test("should accept a specified type") { - typeCheckSuccess(Seq(TypeSignature(Vector(CTInteger), CTInteger)), Seq(CTInteger), CTInteger) - typeCheckSuccess(Seq(TypeSignature(Vector(CTInteger), CTString)), Seq(CTInteger), CTString) - typeCheckSuccess(Seq(TypeSignature(Vector(CTInteger), CTString), - TypeSignature(Vector(CTFloat), CTBoolean)), Seq(CTNumber.covariant), CTBoolean | CTString) - } - - test("any type") { - typeCheckSuccess(Seq(TypeSignature(Vector(CTInteger), CTBoolean), - TypeSignature(Vector(CTFloat), CTFloat)), Seq(CTAny.covariant), CTBoolean | CTFloat) - } - - test("two ExpressionSignatures") { - val sig = Seq(TypeSignature(Vector(CTString), CTInteger), - TypeSignature(Vector(CTNumber), CTInteger)) - typeCheckSuccess(sig, Seq(CTAny.covariant), CTInteger) - typeCheckSuccess(sig, Seq(CTNumber.covariant), CTInteger) - typeCheckSuccess(sig, Seq(CTFloat), CTInteger) - typeCheckSuccess(sig, Seq(CTInteger), CTInteger) - typeCheckSuccess(sig, Seq(CTString), CTInteger) - } - - test("fail on mismatch with ExpressionSignature") { - typeCheckFail(Seq(TypeSignature(Vector(CTBoolean), CTRelationship)), Seq(CTNode)) { errs => - errs should contain("Type mismatch: expected Boolean but was Node") - } - typeCheckFail(Seq(TypeSignature(Vector(CTBoolean), CTRelationship), - TypeSignature(Vector(CTString), CTRelationship), - TypeSignature(Vector(CTMap), CTRelationship)), Seq(CTNumber)) { errs => - errs should contain("Type mismatch: expected Boolean, Map, Node, Relationship or String but was Number") - } - - typeCheckFail(Seq(TypeSignature(Vector(CTBoolean, CTNode, CTInteger), CTRelationship)), Seq(CTBoolean, CTNode, CTFloat)) { errs => - errs should contain("Type mismatch: expected Integer but was Float") - } - } - - test("should pick the most specific ExpressionSignature of many applicable maps") { - val identityExpressionSignature = Seq(TypeSignature(Vector(CTMap), CTMap), - TypeSignature(Vector(CTRelationship), CTRelationship), - TypeSignature(Vector(CTNode), CTNode)) - typeCheckSuccess(identityExpressionSignature, Seq(CTAny.covariant), CTMap | CTNode | CTRelationship) - typeCheckSuccess(identityExpressionSignature, Seq(CTMap.invariant), CTMap) - typeCheckSuccess(identityExpressionSignature, Seq(CTMap.covariant), CTMap | CTNode | CTRelationship) - typeCheckSuccess(identityExpressionSignature, Seq(CTNode), CTMap | CTNode) - typeCheckSuccess(identityExpressionSignature, Seq(CTRelationship), CTMap | CTRelationship) - } - - test("should pick the most specific ExpressionSignature of many applicable numbers") { - val identityExpressionSignature = Seq(TypeSignature(Vector(CTInteger), CTInteger), - TypeSignature(Vector(CTFloat), CTFloat)) - typeCheckSuccess(identityExpressionSignature, Seq(CTAny.covariant), CTInteger | CTFloat) - typeCheckSuccess(identityExpressionSignature, Seq(CTNumber.covariant), CTInteger | CTFloat) - typeCheckSuccess(identityExpressionSignature, Seq(CTInteger), CTInteger) - typeCheckSuccess(identityExpressionSignature, Seq(CTFloat), CTFloat) - } - - test("should handle combined typespecs") { - val ExpressionSignatures = Seq(TypeSignature(Vector(CTInteger, CTInteger), CTInteger), - TypeSignature(Vector(CTNumber, CTNumber), CTFloat)) - typeCheckSuccess(ExpressionSignatures, Seq(CTInteger, CTInteger), CTFloat | CTInteger) - } - - test("pretty print") { - TypeSpec.formatArguments(Seq(CTNumber, CTBoolean, CTString)) should equal("(Number, Boolean, String)") - } - - private def typeCheck(ExpressionSignatures: Seq[TypeSignature], arguments: Seq[TypeSpec]): (TypeExpr, SemanticCheckResult) = { - val argExpressions = arguments.map(DummyExpression(_)) - val semanticState = argExpressions.foldLeft(SemanticState.clean) { - case (state, inner) => state.specifyType(inner, inner.possibleTypes).right.get - } - val expr = TypeExpr(argExpressions) - val check = SemanticExpressionCheck.checkTypes(expr, ExpressionSignatures)(semanticState) - (expr, check) - } - - private def typeCheckSuccess(ExpressionSignatures: Seq[TypeSignature], arguments: Seq[TypeSpec], spec: TypeSpec) = { - val (expr, check) = typeCheck(ExpressionSignatures, arguments) - check.errors shouldBe empty - check.state.typeTable.get(expr).map(_.specified) should equal(Some(spec)) - } - - private def typeCheckFail(ExpressionSignatures: Seq[TypeSignature], arguments: Seq[TypeSpec])(checkError: Seq[String] => Unit) = { - val (_, check) = typeCheck(ExpressionSignatures, arguments) - checkError(check.errors.map(_.msg.replaceAll("\\s+", " "))) - } - - case class TypeExpr(override val arguments: Seq[Expression]) extends Expression { - override def position: InputPosition = pos - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ExpressionTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ExpressionTest.scala deleted file mode 100644 index 8900d81e200fb..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ExpressionTest.scala +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.IdentityMap -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions._ - -class ExpressionTest extends CypherFunSuite with AstConstructionTestSupport { - - val expression = DummyExpression(CTAny, DummyPosition(0)) - - test("should compute dependencies of simple expressions") { - varFor("a").dependencies should equal(Set(varFor("a"))) - SignedDecimalIntegerLiteral("1")(pos).dependencies should equal(Set()) - } - - test("should compute dependencies of composite expressions") { - Add(varFor("a"), Subtract(SignedDecimalIntegerLiteral("1")(pos), varFor("b"))_)(pos).dependencies should equal(Set(varFor("a"), varFor("b"))) - } - - test("should compute dependencies for filtering expressions") { - // extract(x IN (n)-->(k) | head(nodes(x)) ) - val pat: RelationshipsPattern = RelationshipsPattern( - RelationshipChain( - NodePattern(Some(varFor("n")), Seq.empty, None)_, - RelationshipPattern(None, Seq.empty, None, None, SemanticDirection.OUTGOING)_, - NodePattern(Some(varFor("k")), Seq.empty, None)_ - )_ - )_ - val expr: Expression = ExtractExpression( - varFor("x"), - PatternExpression(pat), - None, - Some(FunctionInvocation(FunctionName("head")_, FunctionInvocation(FunctionName("nodes")_, varFor("x"))_)_) - )_ - - expr.dependencies should equal(Set(varFor("n"), varFor("k"))) - } - - test("should compute dependencies for nested filtering expressions") { - // extract(x IN (n)-->(k) | extract(y IN [1,2,3] | y) ) - val pat: RelationshipsPattern = RelationshipsPattern( - RelationshipChain( - NodePattern(Some(varFor("n")), Seq.empty, None)_, - RelationshipPattern(None, Seq.empty, None, None, SemanticDirection.OUTGOING)_, - NodePattern(Some(varFor("k")), Seq.empty, None)_ - )_ - )_ - val innerExpr: Expression = ExtractExpression( - varFor("y"), - ListLiteral(Seq(literalInt(1), literalInt(2), literalInt(3)))_, - None, - Some(varFor("y")) - )_ - val expr: Expression = ExtractExpression( - varFor("x"), - PatternExpression(pat), - None, - Some(innerExpr) - )_ - - expr.dependencies should equal(Set(varFor("n"), varFor("k"))) - } - - test("should compute dependencies for pattern comprehensions") { - // [ (n)-->(k) | k ] - val pat: RelationshipsPattern = RelationshipsPattern( - RelationshipChain( - NodePattern(Some(varFor("n")), Seq.empty, None)_, - RelationshipPattern(None, Seq.empty, None, None, SemanticDirection.OUTGOING)_, - NodePattern(Some(varFor("k")), Seq.empty, None)_ - )_ - )_ - val expr = PatternComprehension( - namedPath = None, - pattern = pat, - predicate = None, - projection = varFor("k") - )(pos) - - expr.withOuterScope(Set(varFor("n"), varFor("k"))).dependencies should equal(Set(varFor("n"), varFor("k"))) - expr.withOuterScope(Set.empty).dependencies should equal(Set.empty) - } - - test("should compute inputs of composite expressions") { - val identA = varFor("a") - val identB = varFor("b") - val lit1 = SignedDecimalIntegerLiteral("1")(pos) - val sub = Subtract(lit1, identB)(pos) - val add = Add(identA, sub)(pos) - - IdentityMap(add.inputs: _*) should equal(IdentityMap( - identA -> Set.empty, - identB -> Set.empty, - lit1 -> Set.empty, - sub -> Set.empty, - add -> Set.empty - )) - } - - test("should compute inputs for filtering expressions") { - // given - val pat = PatternExpression(RelationshipsPattern( - RelationshipChain( - NodePattern(Some(varFor("n")), Seq.empty, None)_, - RelationshipPattern(None, Seq.empty, None, None, SemanticDirection.OUTGOING)_, - NodePattern(Some(varFor("k")), Seq.empty, None)_ - )_ - )_) - - val callNodes: Expression = FunctionInvocation(FunctionName("nodes") _, varFor("x"))_ - val callHead: Expression = FunctionInvocation(FunctionName("head") _, callNodes) _ - - // extract(x IN (n)-->(k) | head(nodes(x)) ) - val expr: Expression = ExtractExpression( - varFor("x"), - pat, - None, - Some(callHead) - )_ - - // when - val inputs = IdentityMap(expr.inputs: _*) - - // then - inputs(callNodes) should equal(Set(varFor("x"))) - inputs(callHead) should equal(Set(varFor("x"))) - inputs(expr) should equal(Set.empty) - inputs(pat) should equal(Set.empty) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/FindDuplicateRelationshipsTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/FindDuplicateRelationshipsTest.scala deleted file mode 100644 index 9c584c5a010a5..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/FindDuplicateRelationshipsTest.scala +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ - -class FindDuplicateRelationshipsTest extends CypherFunSuite { - - val pos = DummyPosition(0) - val node = NodePattern(None, Seq.empty, None)(pos) - val relR = Variable("r")(pos) - val relS = Variable("s")(pos) - - test("find duplicate relationships across pattern parts") { - val relPath = EveryPath(RelationshipChain(node, relPattern(relR), node)(pos)) - val pattern = Pattern(Seq(relPath, relPath))(pos) - - Pattern.findDuplicateRelationships(pattern) should equal(Set(Seq(relR, relR))) - } - - test("find duplicate relationships in a long rel chain") { - val relPath = EveryPath(relChain(relR, relS, relR)) - val pattern = Pattern(Seq(relPath))(pos) - - Pattern.findDuplicateRelationships(pattern) should equal(Set(Seq(relR, relR))) - } - - test("does not find duplicate relationships across pattern parts if there is none") { - val relPath = EveryPath(RelationshipChain(node, relPattern(relR), node)(pos)) - val otherRelPath = EveryPath(RelationshipChain(node, relPattern(relS), node)(pos)) - val pattern = Pattern(Seq(relPath, otherRelPath))(pos) - - Pattern.findDuplicateRelationships(pattern) should equal(Set.empty) - } - - test("does not find duplicate relationships in a long rel chain if there is none") { - val relPath = EveryPath(relChain(relS, relR)) - val pattern = Pattern(Seq(relPath))(pos) - - Pattern.findDuplicateRelationships(pattern) should equal(Set.empty) - } - - private def relChain(ids: Variable*) = - ids.foldRight(node.asInstanceOf[PatternElement]) { - (id, n) => RelationshipChain(n, relPattern(id), node)(pos) - } - - private def relPattern(id: Variable) = - RelationshipPattern(Some(id), Seq(), None, None, SemanticDirection.OUTGOING)(pos) -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/FunctionNameTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/FunctionNameTest.scala deleted file mode 100644 index e54bc87f6e5e7..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/FunctionNameTest.scala +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.FunctionName - -class FunctionNameTest extends CypherFunSuite { - test("equality should ignore case") { - FunctionName("foo")(null) should equal(FunctionName("FOO")(null)) - } - test("equality should respect the name") { - FunctionName("foo")(null) should not equal FunctionName("FOOB")(null) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/GraphReturnItemsTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/GraphReturnItemsTest.scala deleted file mode 100644 index f6c66163a1524..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/GraphReturnItemsTest.scala +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{Scope, SemanticFeature, SemanticState} - -class GraphReturnItemsTest extends CypherFunSuite with AstConstructionTestSupport { - - val foo: BoundGraphAs = graph("foo") - val bar: BoundGraphAs = graph("bar") - val baz: BoundGraphAs = graph("baz") - val moep: BoundGraphAs = graph("moep") - - test("set correct source and target") { - val items = GraphReturnItems(includeExisting = false, List( - ReturnedGraph(baz)(pos), - NewContextGraphs(foo, Some(bar))(pos), - ReturnedGraph(moep)(pos) - ))(pos) - - items.newSource should equal(Some(foo)) - items.newTarget should equal(Some(bar)) - } - - test("set correct source graph") { - val items = GraphReturnItems(includeExisting = false, List( - ReturnedGraph(baz)(pos), - NewContextGraphs(foo, None)(pos), - ReturnedGraph(moep)(pos) - ))(pos) - - items.newSource should equal(Some(foo)) - items.newTarget should equal(Some(foo)) - } - - test("set correct target graph after setting source graph only") { - val items = GraphReturnItems(includeExisting = false, List( - ReturnedGraph(baz)(pos), - NewContextGraphs(foo, None)(pos), - NewTargetGraph(bar)(pos), - ReturnedGraph(moep)(pos) - ))(pos) - - items.newSource should equal(Some(foo)) - items.newTarget should equal(Some(bar)) - } - - test("allow only setting one new source") { - val items = GraphReturnItems(includeExisting = false, List( - NewContextGraphs(foo, Some(bar))(pos), - NewContextGraphs(baz, None)(pos) - ))(pos) - - val result = items.semanticCheck(SemanticState.clean.withFeatures(SemanticFeature.MultipleGraphs)) - val errors = result.errors.toSet - - errors.exists(_.msg.contains("Setting multiple source graphs is not allowed")) should be(true) - } - - test("allow only setting one new target") { - val items = GraphReturnItems(includeExisting = false, List( - NewTargetGraph(foo)(pos), - NewTargetGraph(bar)(pos) - ))(pos) - - val result = items.semanticCheck(SemanticState.clean.withFeatures(SemanticFeature.MultipleGraphs)) - val errors = result.errors.toSet - - errors.exists(_.msg.contains("Setting multiple target graphs is not allowed")) should be(true) - } - - test("set correct source and target from single graph") { - val items = GraphReturnItems(includeExisting = false, List( - ReturnedGraph(baz)(pos) - ))(pos) - - items.newSource should equal(Some(baz)) - items.newTarget should equal(Some(baz)) - } - - test("set correct source and target from single source") { - val items = GraphReturnItems(includeExisting = false, List( - NewContextGraphs(baz, Some(baz))(pos) - ))(pos) - - items.newSource should equal(Some(baz)) - items.newTarget should equal(Some(baz)) - } - - test("set correct source and target from single target") { - val items = GraphReturnItems(includeExisting = false, List( - NewTargetGraph(baz)(pos) - ))(pos) - - items.newSource should equal(Some(baz)) - items.newTarget should equal(Some(baz)) - } - - test("disallow declaring variable multiple times") { - val items = GraphReturnItems(includeExisting = false, List( - ReturnedGraph(graphAt("foo", "url"))(pos), - ReturnedGraph(graphAt("foo", "url2"))(pos) - ))(pos) - - val result = items.declareGraphs(Scope.empty, isReturn = false)(SemanticState.clean.withFeatures(SemanticFeature.MultipleGraphs)) - val errors = result.errors.toSet - - errors.exists(_.msg.contains("Graph `foo` already declared")) should be(true) - } - - test("disallow multiple result graphs with same name") { - val items = GraphReturnItems(includeExisting = false, List( - ReturnedGraph(graphAt("foo", "url"))(pos), - ReturnedGraph(graphAs("foo", "foo"))(pos) - ))(pos) - - val result = items.semanticCheck(SemanticState.clean.withFeatures(SemanticFeature.MultipleGraphs)) - val errors = result.errors.toSet - - errors.exists(_.msg.contains("Multiple result graphs with the same name are not supported")) should be(true) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/IsAggregateTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/IsAggregateTest.scala deleted file mode 100644 index a73e6fa261153..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/IsAggregateTest.scala +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ - -class IsAggregateTest extends CypherFunSuite with AstConstructionTestSupport { - - test("count(*) is an aggregate expression") { - val expr: Expression = CountStar()_ - - IsAggregate.unapply(expr) should equal(Some(expr)) - } - - test("max(null) is an aggregate expression") { - val expr: Expression = FunctionInvocation(FunctionName("max")_, Null()_)_ - - IsAggregate.unapply(expr) should equal(Some(expr)) - } - - test("distinct id(null) an aggregate expression") { - val expr: Expression = FunctionInvocation(Namespace()_, FunctionName("id")_, distinct = true, Vector(Null()_))(pos) - - IsAggregate.unapply(expr) should equal(Some(expr)) - } - - test("id(null) is not an aggregate expression") { - val expr: Expression = FunctionInvocation(Namespace()_, FunctionName("id")_, distinct = false, Vector(Null()_))(pos) - - IsAggregate.unapply(expr) should equal(None) - } - - test("1 is not an aggregate expression") { - val expr: Expression = SignedDecimalIntegerLiteral("1")_ - - IsAggregate.unapply(expr) should equal(None) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/LoadCSVTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/LoadCSVTest.scala deleted file mode 100644 index 29c4921757df1..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/LoadCSVTest.scala +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticError, SemanticState} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{StringLiteral, Variable} - -class LoadCSVTest extends CypherFunSuite { - - val literalURL = StringLiteral("file:///tmp/foo.csv")(DummyPosition(4)) - val variable = Variable("a")(DummyPosition(4)) - - test("cannot overwrite existing variable") { - val loadCSV = LoadCSV(withHeaders = true, literalURL, variable, None)(DummyPosition(6)) - val result = loadCSV.semanticCheck(SemanticState.clean) - assert(result.errors === Seq()) - } - - test("when expecting headers, the variable has a map type") { - val loadCSV = LoadCSV(withHeaders = true, literalURL, variable, None)(DummyPosition(6)) - val result = loadCSV.semanticCheck(SemanticState.clean) - val expressionType = result.state.expressionType(variable).actual - - assert(expressionType === CTMap.invariant) - } - - test("when not expecting headers, the variable has a list type") { - val loadCSV = LoadCSV(withHeaders = false, literalURL, variable, None)(DummyPosition(6)) - val result = loadCSV.semanticCheck(SemanticState.clean) - val expressionType = result.state.expressionType(variable).actual - - assert(expressionType === CTList(CTString).invariant) - } - - test("should accept one-character wide field terminators") { - val literal = StringLiteral("http://example.com/foo.csv")(DummyPosition(4)) - val loadCSV = LoadCSV(withHeaders = false, literal, variable, Some(StringLiteral("\t")(DummyPosition(0))))(DummyPosition(6)) - val result = loadCSV.semanticCheck(SemanticState.clean) - assert(result.errors === Vector.empty) - } - - test("should reject more-than-one-character wide field terminators") { - val literal = StringLiteral("http://example.com/foo.csv")(DummyPosition(4)) - val loadCSV = LoadCSV(withHeaders = false, literal, variable, Some(StringLiteral(" ")(DummyPosition(0))))(DummyPosition(6)) - val result = loadCSV.semanticCheck(SemanticState.clean) - assert(result.errors === Vector(SemanticError("CSV field terminator can only be one character wide", DummyPosition(0)))) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/MapProjectionTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/MapProjectionTest.scala deleted file mode 100644 index 1a162f346e8d7..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/MapProjectionTest.scala +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.frontend.v3_5.parser.{Expressions, ParserTest} -import org.neo4j.cypher.internal.v3_5.expressions.SignedDecimalIntegerLiteral -import org.neo4j.cypher.internal.v3_5.{expressions => exp} - -class MapProjectionTest extends ParserTest[Any, Any] with Expressions { - - val t = DummyPosition(0) - - test("testIdentifierCanContainASCII") { - implicit val parserToTest = MapProjection - - parsing("abc{}") shouldGive exp.MapProjection(exp.Variable("abc")(t), Seq.empty)(t) - - parsing("abc{.id}") shouldGive - exp.MapProjection(exp.Variable("abc")(t), - Seq(exp.PropertySelector(exp.Variable("id")(t))(t)))(t) - - parsing("abc{id}") shouldGive - exp.MapProjection(exp.Variable("abc")(t), - Seq(exp.VariableSelector(exp.Variable("id")(t))(t)))(t) - - parsing("abc { id : 42 }") shouldGive - exp.MapProjection(exp.Variable("abc")(t), - Seq(exp.LiteralEntry(exp.PropertyKeyName("id")(t), SignedDecimalIntegerLiteral("42")(t))(t)))(t) - - parsing("abc { `a p a` : 42 }") shouldGive - exp.MapProjection(exp.Variable("abc")(t), - Seq(exp.LiteralEntry(exp.PropertyKeyName("a p a")(t), SignedDecimalIntegerLiteral("42")(t))(t)))(t) - - parsing("abc { id : 42, .foo, bar }") shouldGive - exp.MapProjection(exp.Variable("abc")(t), - Seq( - exp.LiteralEntry(exp.PropertyKeyName("id")(t), SignedDecimalIntegerLiteral("42")(t))(t), - exp.PropertySelector(exp.Variable("foo")(t))(t), - exp.VariableSelector(exp.Variable("bar")(t))(t) - ) - )(t) - } - - def convert(result: Any): Any = result -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/MultipleGraphClauseSemanticCheckingTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/MultipleGraphClauseSemanticCheckingTest.scala deleted file mode 100644 index 156e676f58d63..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/MultipleGraphClauseSemanticCheckingTest.scala +++ /dev/null @@ -1,1279 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.spi.MapToPublicExceptions -import org.neo4j.cypher.internal.util.v3_5.{CypherException, InputPosition} -import org.neo4j.cypher.internal.frontend.v3_5.helpers.StringHelper -import org.neo4j.cypher.internal.frontend.v3_5.parser.ParserTest -import org.neo4j.cypher.internal.frontend.v3_5.phases._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics._ -import org.neo4j.cypher.internal.frontend.v3_5.{PlannerName, ast, parser} -import org.neo4j.cypher.internal.util.v3_5.symbols.CypherType -import org.parboiled.scala.Rule1 - -class MultipleGraphClauseSemanticCheckingTest - extends ParserTest[ast.Statement, SemanticCheckResult] - with parser.Statement - with AstConstructionTestSupport { - - // INFO: Use result.dumpAndExit to debug these tests - - implicit val parser: Rule1[Query] = Query - - test("allows bound nodes in single node pattern GRAPH OF") { - parsing( - """MATCH (a:Swedish) - |RETURN GRAPH result OF (a)""".stripMargin) shouldVerify { result: SemanticCheckResult => - - result.errors shouldBe empty - } - } - - test("allows bound relationships in GRAPH OF") { - parsing( - """MATCH (a)-[r]->(b) - |RETURN GRAPH result OF (a)-[r]->(b)""".stripMargin) shouldVerify { result: SemanticCheckResult => - - result.errors shouldBe empty - } - } - - test("disallow undirected relationships in GRAPH OF") { - parsing( - """MATCH (a)-[r]->(b) - |RETURN GRAPH result OF (b)-[r]-(a)""".stripMargin) shouldVerify { result: SemanticCheckResult => - - result.errorMessages should equal(Set("Only directed relationships are supported in GRAPH OF")) - } - } - - test("Weird no context graphs error") { - parsing( - """MATCH (n)-->(b:B) - |WITH count(b) AS nodes - |RETURN nodes""".stripMargin) shouldVerify { result: SemanticCheckResult => - - result.errors shouldBe empty - - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (Match(false,Pattern(List(EveryPath(RelationshipChain(NodePattern(Some(Variable(n)),List(),None),RelationshipPattern(None,List(),None,None,OUTGOING,false),NodePattern(Some(Variable(b)),List(LabelName(B)),None))))),List(),None),line 1, column 1 (offset: 0)) - |-- - |// (With(false,ReturnItems(false,Vector(AliasedReturnItem(FunctionInvocation(Namespace(List()),FunctionName(count),false,Vector(Variable(b))),Variable(nodes)))),GraphReturnItems(true,List()),None,None,None,None),line 2, column 1 (offset: 18)) - |-- - |// (Return(false,ReturnItems(false,List(AliasedReturnItem(Variable(nodes),Variable(nodes)))),None,None,None,None,Set()),line 3, column 1 (offset: 41)) - |-- - |// End - """ - - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | b: 13 29 - | n: 7 - | } - | { - | nodes: 35 48 - | } - | { - | nodes: 35 48 49 - | } - |}""" - } - } - - test("Should fail due to no context graphs") { - parsing( - """WITH GRAPHS foo - |MATCH (n)-->(b:B) - |WITH count(b) AS nodes GRAPH AT 'uri1' AS bar, GRAPH AT 'uri2' AS baz - |RETURN nodes""".stripMargin) shouldVerify { result: SemanticCheckResult => - - result.errorMessages should equal(Set("No source graph is available in scope")) - } - } - - test("GRAPHS * keeps existing graphs in scope (1)") { - parsing( - """WITH 1 AS a GRAPH source AT 'src' >> GRAPH target AT 'tgt' - |RETURN * GRAPHS *""".stripMargin) shouldVerify { result: SemanticCheckResult => - result.errors shouldBe empty - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,ReturnItems(false,Vector(AliasedReturnItem(SignedDecimalIntegerLiteral(1),Variable(a)))),GraphReturnItems(false,List(NewContextGraphs(GraphAtAs(GraphUrl(Right(StringLiteral(src))),Some(Variable(source)),false),Some(GraphAtAs(GraphUrl(Right(StringLiteral(tgt))),Some(Variable(target)),false))))),None,None,None,None),line 1, column 1 (offset: 0)) - |source >> target - |// (Return(false,ReturnItems(true,List()),Some(GraphReturnItems(true,List())),None,None,None,Set()),line 2, column 1 (offset: 59)) - |-- - |// End - """ - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | } - | { /* source >> target */ - | a: 10 - | GRAPH source: 18 - | GRAPH target: 43 - | } - | { - | a: 10 - | GRAPH source: 18 - | GRAPH target: 43 - | } - |}""" - } - } - - test("GRAPHS * keeps existing graphs in scope (2)") { - parsing( - """WITH 1 AS a GRAPH source AT 'src' >> GRAPH target AT 'tgt' - |RETURN GRAPHS * - """.stripMargin) shouldVerify { result: SemanticCheckResult => - result.errors shouldBe empty - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,ReturnItems(false,Vector(AliasedReturnItem(SignedDecimalIntegerLiteral(1),Variable(a)))),GraphReturnItems(false,List(NewContextGraphs(GraphAtAs(GraphUrl(Right(StringLiteral(src))),Some(Variable(source)),false),Some(GraphAtAs(GraphUrl(Right(StringLiteral(tgt))),Some(Variable(target)),false))))),None,None,None,None),line 1, column 1 (offset: 0)) - |source >> target - |// (Return(false,DiscardCardinality(),Some(GraphReturnItems(true,List())),None,None,None,Set()),line 2, column 1 (offset: 59)) - |-- - |// End - """ - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | } - | { /* source >> target */ - | a: 10 - | GRAPH source: 18 - | GRAPH target: 43 - | } - | { - | GRAPH source: 18 - | GRAPH target: 43 - | } - |}""" - } - } - - test("WITH * passes on whatever graphs are in scope") { - parsing( - """WITH GRAPH source AT 'src' >> GRAPH target AT 'tgt' - |WITH 1 AS a - |RETURN * GRAPHS * - """.stripMargin) shouldVerify { result: SemanticCheckResult => - result.errors shouldBe empty - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,DiscardCardinality(),GraphReturnItems(false,List(NewContextGraphs(GraphAtAs(GraphUrl(Right(StringLiteral(src))),Some(Variable(source)),false),Some(GraphAtAs(GraphUrl(Right(StringLiteral(tgt))),Some(Variable(target)),false))))),None,None,None,None),line 1, column 1 (offset: 0)) - |source >> target - |// (With(false,ReturnItems(false,Vector(AliasedReturnItem(SignedDecimalIntegerLiteral(1),Variable(a)))),GraphReturnItems(true,List()),None,None,None,None),line 2, column 1 (offset: 52)) - |source >> target - |// (Return(false,ReturnItems(true,List()),Some(GraphReturnItems(true,List())),None,None,None,Set()),line 3, column 1 (offset: 64)) - |-- - |// End - """ - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | } - | { /* source >> target */ - | GRAPH source: 11 - | GRAPH target: 36 - | } - | { /* source >> target */ - | a: 62 - | GRAPH source: 11 - | GRAPH target: 36 - | } - | { - | a: 62 - | GRAPH source: 11 - | GRAPH target: 36 - | } - |}""" - } - } - - test("WITH GRAPHS controls which graphs are in scope (1)") { - parsing( - """WITH GRAPH source AT 'src' >> GRAPH target AT 'tgt' - |RETURN GRAPH foo AT 'url', GRAPH bar AT 'url'""".stripMargin) shouldVerify { result: SemanticCheckResult => - result.errors shouldBe empty - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,DiscardCardinality(),GraphReturnItems(false,List(NewContextGraphs(GraphAtAs(GraphUrl(Right(StringLiteral(src))),Some(Variable(source)),false),Some(GraphAtAs(GraphUrl(Right(StringLiteral(tgt))),Some(Variable(target)),false))))),None,None,None,None),line 1, column 1 (offset: 0)) - |source >> target - |// (Return(false,DiscardCardinality(),Some(GraphReturnItems(false,List(ReturnedGraph(GraphAtAs(GraphUrl(Right(StringLiteral(url))),Some(Variable(foo)),false)), ReturnedGraph(GraphAtAs(GraphUrl(Right(StringLiteral(url))),Some(Variable(bar)),false))))),None,None,None,Set()),line 2, column 1 (offset: 52)) - |-- - |// End - """ - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | } - | { /* source >> target */ - | GRAPH source: 11 - | GRAPH target: 36 - | } - | { - | GRAPH bar: 85 - | GRAPH foo: 65 - | } - |}""" - } - } - - test("WITH GRAPHS controls which graphs are in scope (2)") { - parsing( - """WITH 1 AS a GRAPH source AT 'src' >> GRAPH target AT 'tgt' - |RETURN a""".stripMargin) shouldVerify { result: SemanticCheckResult => - result.errors shouldBe empty - result.formattedContexts shouldEqualFixNewlines - """ - |// Start - |-- - |// (With(false,ReturnItems(false,Vector(AliasedReturnItem(SignedDecimalIntegerLiteral(1),Variable(a)))),GraphReturnItems(false,List(NewContextGraphs(GraphAtAs(GraphUrl(Right(StringLiteral(src))),Some(Variable(source)),false),Some(GraphAtAs(GraphUrl(Right(StringLiteral(tgt))),Some(Variable(target)),false))))),None,None,None,None),line 1, column 1 (offset: 0)) - |source >> target - |// (Return(false,ReturnItems(false,List(AliasedReturnItem(Variable(a),Variable(a)))),None,None,None,None,Set()),line 2, column 1 (offset: 59)) - |-- - |// End - """ - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | } - | { /* source >> target */ - | a: 10 66 - | GRAPH source: 18 - | GRAPH target: 43 - | } - | { - | a: 10 66 67 - | } - |}""" - } - } - - test("WITH GRAPHS controls which graphs are in scope (3)") { - parsing( - """WITH 1 AS a GRAPH source AT 'src' >> GRAPH target AT 'tgt' - |WITH a GRAPH source - |RETURN a""".stripMargin) shouldVerify { result: SemanticCheckResult => - result.errors shouldBe empty - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,ReturnItems(false,Vector(AliasedReturnItem(SignedDecimalIntegerLiteral(1),Variable(a)))),GraphReturnItems(false,List(NewContextGraphs(GraphAtAs(GraphUrl(Right(StringLiteral(src))),Some(Variable(source)),false),Some(GraphAtAs(GraphUrl(Right(StringLiteral(tgt))),Some(Variable(target)),false))))),None,None,None,None),line 1, column 1 (offset: 0)) - |source >> target - |// (With(false,ReturnItems(false,Vector(AliasedReturnItem(Variable(a),Variable(a)))),GraphReturnItems(false,List(ReturnedGraph(GraphAs(Variable(source),Some(Variable(source)),false)))),None,None,None,None),line 2, column 1 (offset: 59)) - |source >> source - |// (Return(false,ReturnItems(false,List(AliasedReturnItem(Variable(a),Variable(a)))),None,None,None,None,Set()),line 3, column 1 (offset: 79)) - |-- - |// End - """ - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | } - | { /* source >> target */ - | a: 10 64 - | GRAPH source: 18 72 - | GRAPH target: 43 - | } - | { /* source >> source */ - | a: 10 64 65 86 - | GRAPH source: 72 - | } - | { - | a: 10 64 65 86 87 - | } - |}""" - } - } - - test("WITH GRAPHS controls which graphs are in scope (4)") { - parsing( - """WITH 1 AS a GRAPH source AT 'src' >> GRAPH target AT 'tgt' - |WITH a GRAPH source - |WITH a GRAPH target - |RETURN a""".stripMargin) shouldVerify { result: SemanticCheckResult => - result.errorMessages should equal(Set("Variable `target` not defined")) - } - } - - test("Intermediary clauses don't lose graphs") { - parsing( - """WITH 1 AS a GRAPH source AT 'src' >> GRAPH target AT 'tgt' - |MATCH (b) - |WITH a - |MATCH (c) - |RETURN a, c""".stripMargin) shouldVerify { result: SemanticCheckResult => - result.errors shouldBe empty - result.formattedContexts shouldEqualFixNewlines - """ - |// Start - |-- - |// (With(false,ReturnItems(false,Vector(AliasedReturnItem(SignedDecimalIntegerLiteral(1),Variable(a)))),GraphReturnItems(false,List(NewContextGraphs(GraphAtAs(GraphUrl(Right(StringLiteral(src))),Some(Variable(source)),false),Some(GraphAtAs(GraphUrl(Right(StringLiteral(tgt))),Some(Variable(target)),false))))),None,None,None,None),line 1, column 1 (offset: 0)) - |source >> target - |// (Match(false,Pattern(List(EveryPath(NodePattern(Some(Variable(b)),List(),None)))),List(),None),line 2, column 1 (offset: 59)) - |source >> target - |// (With(false,ReturnItems(false,Vector(AliasedReturnItem(Variable(a),Variable(a)))),GraphReturnItems(true,List()),None,None,None,None),line 3, column 1 (offset: 69)) - |source >> target - |// (Match(false,Pattern(List(EveryPath(NodePattern(Some(Variable(c)),List(),None)))),List(),None),line 4, column 1 (offset: 76)) - |source >> target - |// (Return(false,ReturnItems(false,List(AliasedReturnItem(Variable(a),Variable(a)), AliasedReturnItem(Variable(c),Variable(c)))),None,None,None,None,Set()),line 5, column 1 (offset: 86)) - |-- - |// End - """ - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | } - | { /* source >> target */ - | a: 10 74 - | b: 66 - | GRAPH source: 18 - | GRAPH target: 43 - | } - | { /* source >> target */ - | a: 10 74 75 93 - | c: 83 96 - | GRAPH source: 18 - | GRAPH target: 43 - | } - | { - | a: 10 74 75 93 94 - | c: 83 96 97 - | } - |}""" - } - } - - test("FROM introduces new source and target graphs") { - parsing( - """WITH 1 AS a GRAPH source AT 'src' >> GRAPH target AT 'tgt' - |FROM GRAPH new AT 'new' - |MATCH (b) - |RETURN a GRAPHS *""".stripMargin) shouldVerify { result: SemanticCheckResult => - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,ReturnItems(false,Vector(AliasedReturnItem(SignedDecimalIntegerLiteral(1),Variable(a)))),GraphReturnItems(false,List(NewContextGraphs(GraphAtAs(GraphUrl(Right(StringLiteral(src))),Some(Variable(source)),false),Some(GraphAtAs(GraphUrl(Right(StringLiteral(tgt))),Some(Variable(target)),false))))),None,None,None,None),line 1, column 1 (offset: 0)) - |source >> target - |// (With(false,ReturnItems(true,Vector()),GraphReturnItems(true,List(NewContextGraphs(GraphAtAs(GraphUrl(Right(StringLiteral(new))),Some(Variable(new)),false),None))),None,None,None,None),line 2, column 6 (offset: 64)) - |new >> new - |// (Match(false,Pattern(List(EveryPath(NodePattern(Some(Variable(b)),List(),None)))),List(),None),line 3, column 1 (offset: 83)) - |new >> new - |// (Return(false,ReturnItems(false,List(AliasedReturnItem(Variable(a),Variable(a)))),Some(GraphReturnItems(true,List())),None,None,None,Set()),line 4, column 1 (offset: 93)) - |-- - |// End - """ - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | } - | { /* source >> target */ - | a: 10 - | GRAPH source: 18 - | GRAPH target: 43 - | } - | { /* new >> new */ - | a: 10 100 - | b: 90 - | GRAPH new: 70 - | GRAPH source: 18 - | GRAPH target: 43 - | } - | { - | a: 10 100 101 - | GRAPH new: 70 - | GRAPH source: 18 - | GRAPH target: 43 - | } - |}""" - } - } - - test("INTO introduces new target graph") { - parsing( - """WITH 1 AS a GRAPH source AT 'src' >> GRAPH target AT 'tgt' - |INTO GRAPH new AT 'new' - |RETURN a""".stripMargin) shouldVerify { result: SemanticCheckResult => - - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,ReturnItems(false,Vector(AliasedReturnItem(SignedDecimalIntegerLiteral(1),Variable(a)))),GraphReturnItems(false,List(NewContextGraphs(GraphAtAs(GraphUrl(Right(StringLiteral(src))),Some(Variable(source)),false),Some(GraphAtAs(GraphUrl(Right(StringLiteral(tgt))),Some(Variable(target)),false))))),None,None,None,None),line 1, column 1 (offset: 0)) - |source >> target - |// (With(false,ReturnItems(true,Vector()),GraphReturnItems(true,List(NewTargetGraph(GraphAtAs(GraphUrl(Right(StringLiteral(new))),Some(Variable(new)),false)))),None,None,None,None),line 2, column 6 (offset: 64)) - |source >> new - |// (Return(false,ReturnItems(false,List(AliasedReturnItem(Variable(a),Variable(a)))),None,None,None,None,Set()),line 3, column 1 (offset: 83)) - |-- - |// End - """ - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | } - | { /* source >> target */ - | a: 10 - | GRAPH source: 18 - | GRAPH target: 43 - | } - | { /* source >> new */ - | a: 10 90 - | GRAPH new: 70 - | GRAPH source: 18 - | GRAPH target: 43 - | } - | { - | a: 10 90 91 - | } - |}""" - } - } - - test("graph name conflict") { - parsing( - """WITH GRAPH AT 'url' AS foo >> GRAPH AT 'url' AS bar - |WITH GRAPHS >> foo AS foo, bar AS foo - |RETURN 1""".stripMargin) shouldVerify { result: SemanticCheckResult => - result.errorMessages should equal(Set("Multiple result graphs with the same name are not supported")) - } - } - - test("WITH is allowed to refer to missing graphs at the start of query") { - parsing( - """WITH GRAPHS foo >> bar - |RETURN 1""".stripMargin) shouldVerify { result: SemanticCheckResult => - - result.errors shouldBe empty - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,DiscardCardinality(),GraphReturnItems(false,List(NewContextGraphs(GraphAs(Variable(foo),Some(Variable(foo)),false),Some(GraphAs(Variable(bar),Some(Variable(bar)),false))))),None,None,None,None),line 1, column 1 (offset: 0)) - |foo >> bar - |// (Return(false,ReturnItems(false,List(AliasedReturnItem(SignedDecimalIntegerLiteral(1),Variable(1)))),None,None,None,None,Set()),line 2, column 1 (offset: 23)) - |-- - |// End""" - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | GRAPH bar: 19 - | GRAPH foo: 12 - | } - | { /* foo >> bar */ - | GRAPH bar: 19 - | GRAPH foo: 12 - | } - | { - | 1: 31 - | } - |}""" - } - } - - test("with is not allowed to refer to missing graphs anywhere else") { - parsing( - """WITH GRAPHS foo >> bar - |WITH GRAPHS zig >> zag - |RETURN 1""".stripMargin) shouldVerify { result: SemanticCheckResult => - - result.errorMessages should equal(Set( - "Variable `zig` not defined", - "Variable `zag` not defined" - )) - } - } - - test("graphs are not lost across update statements") { - parsing( - """WITH GRAPHS foo >> bar - |CREATE (a) - |MERGE (b {name: a.name}) - |CREATE (b)-[:X]->(b) - |WITH * - |DELETE (a) - |RETURN GRAPHS *""".stripMargin) shouldVerify { result: SemanticCheckResult => - result.errors shouldBe empty - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,DiscardCardinality(),GraphReturnItems(false,List(NewContextGraphs(GraphAs(Variable(foo),Some(Variable(foo)),false),Some(GraphAs(Variable(bar),Some(Variable(bar)),false))))),None,None,None,None),line 1, column 1 (offset: 0)) - |foo >> bar - |// (With(false,ReturnItems(true,Vector()),GraphReturnItems(true,List()),None,None,None,None),line 5, column 1 (offset: 80)) - |foo >> bar - |// (Return(false,DiscardCardinality(),Some(GraphReturnItems(true,List())),None,None,None,Set()),line 7, column 1 (offset: 98)) - |-- - |// End""" - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | GRAPH bar: 19 - | GRAPH foo: 12 - | } - | { /* foo >> bar */ - | a: 31 50 - | b: 41 67 77 - | GRAPH bar: 19 - | GRAPH foo: 12 - | } - | { /* foo >> bar */ - | a: 31 50 95 - | b: 41 67 77 - | GRAPH bar: 19 - | GRAPH foo: 12 - | } - | { - | GRAPH bar: 19 - | GRAPH foo: 12 - | } - |}""" - } - } - - test("create graph") { - parsing( - """WITH GRAPHS foo >> bar - |CREATE GRAPH zig AT 'url' - |RETURN 1""".stripMargin) shouldVerify { result: SemanticCheckResult => - - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,DiscardCardinality(),GraphReturnItems(false,List(NewContextGraphs(GraphAs(Variable(foo),Some(Variable(foo)),false),Some(GraphAs(Variable(bar),Some(Variable(bar)),false))))),None,None,None,None),line 1, column 1 (offset: 0)) - |foo >> bar - |// (CreateRegularGraph(false,Variable(zig),None,GraphUrl(Right(StringLiteral(url)))),line 2, column 8 (offset: 30)) - |foo >> bar - |// (Return(false,ReturnItems(false,List(AliasedReturnItem(SignedDecimalIntegerLiteral(1),Variable(1)))),None,None,None,None,Set()),line 3, column 1 (offset: 49)) - |-- - |// End""" - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | GRAPH bar: 19 - | GRAPH foo: 12 - | } - | { /* foo >> bar */ - | GRAPH bar: 19 - | GRAPH foo: 12 - | GRAPH zig: 36 - | } - | { - | 1: 57 - | } - |}""" - } - } - - test("Resolution of unaliased SOURCE GRAPH") { - parsing( - """WITH GRAPHS foo >> bar, baz - |MATCH (a) - |WITH a GRAPH baz, SOURCE GRAPH >> - |MATCH (b) - |RETURN * GRAPHS *""".stripMargin) shouldVerify { result: SemanticCheckResult => - result.errors shouldBe empty - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,DiscardCardinality(),GraphReturnItems(false,List(NewContextGraphs(GraphAs(Variable(foo),Some(Variable(foo)),false),Some(GraphAs(Variable(bar),Some(Variable(bar)),false))), ReturnedGraph(GraphAs(Variable(baz),Some(Variable(baz)),false)))),None,None,None,None),line 1, column 1 (offset: 0)) - |foo >> bar - |// (Match(false,Pattern(List(EveryPath(NodePattern(Some(Variable(a)),List(),None)))),List(),None),line 2, column 1 (offset: 28)) - |foo >> bar - |// (With(false,ReturnItems(false,Vector(AliasedReturnItem(Variable(a),Variable(a)))),GraphReturnItems(false,List(ReturnedGraph(GraphAs(Variable(baz),Some(Variable(baz)),false)), NewContextGraphs(SourceGraphAs(None,false),None))),None,None,None,None),line 3, column 1 (offset: 38)) - |foo >> foo - |// (Match(false,Pattern(List(EveryPath(NodePattern(Some(Variable(b)),List(),None)))),List(),None),line 4, column 1 (offset: 72)) - |foo >> foo - |// (Return(false,ReturnItems(true,List()),Some(GraphReturnItems(true,List())),None,None,None,Set()),line 5, column 1 (offset: 82)) - |-- - |// End""" - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | GRAPH bar: 19 - | GRAPH baz: 24 - | GRAPH foo: 12 - | } - | { /* foo >> bar */ - | a: 35 43 - | GRAPH bar: 19 - | GRAPH baz: 24 51 - | GRAPH foo: 12 - | } - | { /* foo >> foo */ - | a: 35 43 44 - | b: 79 - | GRAPH baz: 51 - | GRAPH foo: 69 - | } - | { - | a: 35 43 44 - | b: 79 - | GRAPH baz: 51 - | GRAPH foo: 69 - | } - |}""" - } - } - - test("create graph and set source") { - parsing( - """WITH GRAPHS foo >> bar - |CREATE GRAPH zig AT 'url' >> - |RETURN 1""".stripMargin) shouldVerify { result: SemanticCheckResult => - - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,DiscardCardinality(),GraphReturnItems(false,List(NewContextGraphs(GraphAs(Variable(foo),Some(Variable(foo)),false),Some(GraphAs(Variable(bar),Some(Variable(bar)),false))))),None,None,None,None),line 1, column 1 (offset: 0)) - |foo >> bar - |// (CreateRegularGraph(false,Variable(zig),None,GraphUrl(Right(StringLiteral(url)))),line 2, column 27 (offset: 49)) - |foo >> bar - |// (With(false,ReturnItems(true,Vector()),GraphReturnItems(true,List(NewContextGraphs(GraphAs(Variable(zig),Some(Variable(zig)),false),None))),None,None,None,None),line 2, column 27 (offset: 49)) - |zig >> zig - |// (Return(false,ReturnItems(false,List(AliasedReturnItem(SignedDecimalIntegerLiteral(1),Variable(1)))),None,None,None,None,Set()),line 3, column 1 (offset: 52)) - |-- - |// End""" - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | GRAPH bar: 19 - | GRAPH foo: 12 - | } - | { /* foo >> bar */ - | GRAPH bar: 19 - | GRAPH foo: 12 - | GRAPH zig: 36 - | } - | { /* zig >> zig */ - | GRAPH bar: 19 - | GRAPH foo: 12 - | GRAPH zig: 36 - | } - | { - | 1: 60 - | } - |}""" - } - } - - test("Resolution of unaliased SOURCE GRAPH does not fail if graph is also passed on explicitly") { - parsing( - """WITH GRAPHS foo >> bar, baz - |MATCH (a) - |WITH a GRAPH baz, GRAPH foo, SOURCE GRAPH >> - |MATCH (b) - |RETURN * GRAPHS *""".stripMargin) shouldVerify { result: SemanticCheckResult => - result.errors shouldBe empty - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,DiscardCardinality(),GraphReturnItems(false,List(NewContextGraphs(GraphAs(Variable(foo),Some(Variable(foo)),false),Some(GraphAs(Variable(bar),Some(Variable(bar)),false))), ReturnedGraph(GraphAs(Variable(baz),Some(Variable(baz)),false)))),None,None,None,None),line 1, column 1 (offset: 0)) - |foo >> bar - |// (Match(false,Pattern(List(EveryPath(NodePattern(Some(Variable(a)),List(),None)))),List(),None),line 2, column 1 (offset: 28)) - |foo >> bar - |// (With(false,ReturnItems(false,Vector(AliasedReturnItem(Variable(a),Variable(a)))),GraphReturnItems(false,List(ReturnedGraph(GraphAs(Variable(baz),Some(Variable(baz)),false)), ReturnedGraph(GraphAs(Variable(foo),Some(Variable(foo)),false)), NewContextGraphs(SourceGraphAs(None,false),None))),None,None,None,None),line 3, column 1 (offset: 38)) - |foo >> foo - |// (Match(false,Pattern(List(EveryPath(NodePattern(Some(Variable(b)),List(),None)))),List(),None),line 4, column 1 (offset: 83)) - |foo >> foo - |// (Return(false,ReturnItems(true,List()),Some(GraphReturnItems(true,List())),None,None,None,Set()),line 5, column 1 (offset: 93)) - |-- - |// End""" - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | GRAPH bar: 19 - | GRAPH baz: 24 - | GRAPH foo: 12 - | } - | { /* foo >> bar */ - | a: 35 43 - | GRAPH bar: 19 - | GRAPH baz: 24 51 - | GRAPH foo: 12 62 - | } - | { /* foo >> foo */ - | a: 35 43 44 - | b: 90 - | GRAPH baz: 51 - | GRAPH foo: 62 80 - | } - | { - | a: 35 43 44 - | b: 90 - | GRAPH baz: 51 - | GRAPH foo: 62 80 - | } - |}""" - } - } - - test("Resolution of unaliased TARGET GRAPH does not fail if graph is also passed on explicitly") { - parsing( - """WITH GRAPHS foo >> bar, baz - |MATCH (a) - |WITH a GRAPH bar, GRAPH foo >> TARGET GRAPH - |MATCH (b) - |RETURN * GRAPHS *""".stripMargin) shouldVerify { result: SemanticCheckResult => - result.errors shouldBe empty - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,DiscardCardinality(),GraphReturnItems(false,List(NewContextGraphs(GraphAs(Variable(foo),Some(Variable(foo)),false),Some(GraphAs(Variable(bar),Some(Variable(bar)),false))), ReturnedGraph(GraphAs(Variable(baz),Some(Variable(baz)),false)))),None,None,None,None),line 1, column 1 (offset: 0)) - |foo >> bar - |// (Match(false,Pattern(List(EveryPath(NodePattern(Some(Variable(a)),List(),None)))),List(),None),line 2, column 1 (offset: 28)) - |foo >> bar - |// (With(false,ReturnItems(false,Vector(AliasedReturnItem(Variable(a),Variable(a)))),GraphReturnItems(false,List(ReturnedGraph(GraphAs(Variable(bar),Some(Variable(bar)),false)), NewContextGraphs(GraphAs(Variable(foo),Some(Variable(foo)),false),Some(TargetGraphAs(None,false))))),None,None,None,None),line 3, column 1 (offset: 38)) - |foo >> bar - |// (Match(false,Pattern(List(EveryPath(NodePattern(Some(Variable(b)),List(),None)))),List(),None),line 4, column 1 (offset: 82)) - |foo >> bar - |// (Return(false,ReturnItems(true,List()),Some(GraphReturnItems(true,List())),None,None,None,Set()),line 5, column 1 (offset: 92)) - |-- - |// End""" - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | GRAPH bar: 19 - | GRAPH baz: 24 - | GRAPH foo: 12 - | } - | { /* foo >> bar */ - | a: 35 43 - | GRAPH bar: 19 51 - | GRAPH baz: 24 - | GRAPH foo: 12 62 - | } - | { /* foo >> bar */ - | a: 35 43 44 - | b: 89 - | GRAPH bar: 51 - | GRAPH foo: 62 82 - | } - | { - | a: 35 43 44 - | b: 89 - | GRAPH bar: 51 - | GRAPH foo: 62 82 - | } - |}""" - } - } - - test("Track graphs with generated names") { - parsing( - """WITH GRAPH AT 'url' >> bar, GRAPH baz - |MATCH (a) - |MATCH (b) - |RETURN * GRAPHS *""".stripMargin) shouldVerify { result: SemanticCheckResult => - result.errors shouldBe empty - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,DiscardCardinality(),GraphReturnItems(false,List(NewContextGraphs(GraphAtAs(GraphUrl(Right(StringLiteral(url))),Some(Variable( FRESHID21)),true),Some(GraphAs(Variable(bar),Some(Variable(bar)),false))), ReturnedGraph(GraphAs(Variable(baz),Some(Variable(baz)),false)))),None,None,None,None),line 1, column 1 (offset: 0)) - | FRESHID21 >> bar - |// (Match(false,Pattern(List(EveryPath(NodePattern(Some(Variable(a)),List(),None)))),List(),None),line 2, column 1 (offset: 38)) - | FRESHID21 >> bar - |// (Match(false,Pattern(List(EveryPath(NodePattern(Some(Variable(b)),List(),None)))),List(),None),line 3, column 1 (offset: 48)) - | FRESHID21 >> bar - |// (Return(false,ReturnItems(true,List()),Some(GraphReturnItems(true,List())),None,None,None,Set()),line 4, column 1 (offset: 58)) - |-- - |// End""" - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | GRAPH bar: 23 - | GRAPH baz: 34 - | } - | { /* FRESHID21 >> bar */ - | GRAPH FRESHID21 (generated): 21 - | a: 45 - | b: 55 - | GRAPH bar: 23 - | GRAPH baz: 34 - | } - | { - | GRAPH FRESHID21 (generated): 21 - | a: 45 - | b: 55 - | GRAPH bar: 23 - | GRAPH baz: 34 - | } - |}""" - } - } - - test("UNION ALL handles graphs correctly") { - parsing( - """WITH GRAPH bar AT 'url' >> GRAPH foo AT 'url2' - |MATCH (a:Person) - |RETURN a.name GRAPHS * - |UNION ALL - |WITH GRAPH bar AT 'url' >> GRAPH foo AT 'url2' - |MATCH (a:City) - |RETURN a.name GRAPHS * - |""".stripMargin) shouldVerify { result: SemanticCheckResult => - result.errors shouldBe empty - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,DiscardCardinality(),GraphReturnItems(false,List(NewContextGraphs(GraphAtAs(GraphUrl(Right(StringLiteral(url))),Some(Variable(bar)),false),Some(GraphAtAs(GraphUrl(Right(StringLiteral(url2))),Some(Variable(foo)),false))))),None,None,None,None),line 1, column 1 (offset: 0)) - |bar >> foo - |// (Match(false,Pattern(List(EveryPath(NodePattern(Some(Variable(a)),List(LabelName(Person)),None)))),List(),None),line 2, column 1 (offset: 47)) - |bar >> foo - |// (Return(false,ReturnItems(false,List(AliasedReturnItem(Property(Variable(a),PropertyKeyName(name)),Variable(a.name)))),Some(GraphReturnItems(true,List())),None,None,None,Set()),line 3, column 1 (offset: 64)) - |-- - |// (With(false,DiscardCardinality(),GraphReturnItems(false,List(NewContextGraphs(GraphAtAs(GraphUrl(Right(StringLiteral(url))),Some(Variable(bar)),false),Some(GraphAtAs(GraphUrl(Right(StringLiteral(url2))),Some(Variable(foo)),false))))),None,None,None,None),line 5, column 1 (offset: 97)) - |bar >> foo - |// (Match(false,Pattern(List(EveryPath(NodePattern(Some(Variable(a)),List(LabelName(City)),None)))),List(),None),line 6, column 1 (offset: 144)) - |bar >> foo - |// (Return(false,ReturnItems(false,List(AliasedReturnItem(Property(Variable(a),PropertyKeyName(name)),Variable(a.name)))),Some(GraphReturnItems(true,List())),None,None,None,Set()),line 7, column 1 (offset: 159)) - |-- - |// End""" - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | { - | } - | { /* bar >> foo */ - | a: 54 71 - | GRAPH bar: 11 - | GRAPH foo: 33 - | } - | { - | a.name: 74 - | GRAPH bar: 11 - | GRAPH foo: 33 - | } - | } - | { - | { - | } - | { /* bar >> foo */ - | a: 151 166 - | GRAPH bar: 108 - | GRAPH foo: 130 - | } - | { - | a.name: 169 - | GRAPH bar: 108 - | GRAPH foo: 130 - | } - | } - |}""" - } - } - - test("UNION handles graphs correctly") { - parsing( - """WITH GRAPH bar AT 'url' >> GRAPH foo AT 'url2' - |MATCH (a:Person) - |RETURN a.name GRAPHS * - |UNION - |WITH GRAPH bar AT 'url' >> GRAPH foo AT 'url2' - |MATCH (a:City) - |RETURN a.name GRAPHS * - |""".stripMargin) shouldVerify { result: SemanticCheckResult => - - result.errors shouldBe empty - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,DiscardCardinality(),GraphReturnItems(false,List(NewContextGraphs(GraphAtAs(GraphUrl(Right(StringLiteral(url))),Some(Variable(bar)),false),Some(GraphAtAs(GraphUrl(Right(StringLiteral(url2))),Some(Variable(foo)),false))))),None,None,None,None),line 1, column 1 (offset: 0)) - |bar >> foo - |// (Match(false,Pattern(List(EveryPath(NodePattern(Some(Variable(a)),List(LabelName(Person)),None)))),List(),None),line 2, column 1 (offset: 47)) - |bar >> foo - |// (Return(false,ReturnItems(false,List(AliasedReturnItem(Property(Variable(a),PropertyKeyName(name)),Variable(a.name)))),Some(GraphReturnItems(true,List())),None,None,None,Set()),line 3, column 1 (offset: 64)) - |-- - |// (With(false,DiscardCardinality(),GraphReturnItems(false,List(NewContextGraphs(GraphAtAs(GraphUrl(Right(StringLiteral(url))),Some(Variable(bar)),false),Some(GraphAtAs(GraphUrl(Right(StringLiteral(url2))),Some(Variable(foo)),false))))),None,None,None,None),line 5, column 1 (offset: 93)) - |bar >> foo - |// (Match(false,Pattern(List(EveryPath(NodePattern(Some(Variable(a)),List(LabelName(City)),None)))),List(),None),line 6, column 1 (offset: 140)) - |bar >> foo - |// (Return(false,ReturnItems(false,List(AliasedReturnItem(Property(Variable(a),PropertyKeyName(name)),Variable(a.name)))),Some(GraphReturnItems(true,List())),None,None,None,Set()),line 7, column 1 (offset: 155)) - |-- - |// End""" - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | { - | } - | { /* bar >> foo */ - | a: 54 71 - | GRAPH bar: 11 - | GRAPH foo: 33 - | } - | { - | a.name: 74 - | GRAPH bar: 11 - | GRAPH foo: 33 - | } - | } - | { - | { - | } - | { /* bar >> foo */ - | a: 147 162 - | GRAPH bar: 104 - | GRAPH foo: 126 - | } - | { - | a.name: 165 - | GRAPH bar: 104 - | GRAPH foo: 126 - | } - | } - |}""" - } - } - - test("create graph and set target") { - parsing( - """WITH GRAPHS foo >> bar - |CREATE >> GRAPH zig AT 'url' - |RETURN 1""".stripMargin) shouldVerify { result: SemanticCheckResult => - - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,DiscardCardinality(),GraphReturnItems(false,List(NewContextGraphs(GraphAs(Variable(foo),Some(Variable(foo)),false),Some(GraphAs(Variable(bar),Some(Variable(bar)),false))))),None,None,None,None),line 1, column 1 (offset: 0)) - |foo >> bar - |// (CreateRegularGraph(false,Variable(zig),None,GraphUrl(Right(StringLiteral(url)))),line 2, column 11 (offset: 33)) - |foo >> bar - |// (With(false,ReturnItems(true,Vector()),GraphReturnItems(true,List(NewTargetGraph(GraphAs(Variable(zig),Some(Variable(zig)),false)))),None,None,None,None),line 2, column 11 (offset: 33)) - |foo >> zig - |// (Return(false,ReturnItems(false,List(AliasedReturnItem(SignedDecimalIntegerLiteral(1),Variable(1)))),None,None,None,None,Set()),line 3, column 1 (offset: 52)) - |-- - |// End""" - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | GRAPH bar: 19 - | GRAPH foo: 12 - | } - | { /* foo >> bar */ - | GRAPH bar: 19 - | GRAPH foo: 12 - | GRAPH zig: 39 - | } - | { /* foo >> zig */ - | GRAPH bar: 19 - | GRAPH foo: 12 - | GRAPH zig: 39 - | } - | { - | 1: 60 - | } - |}""" - } - } - - test("using graph variable in normal variable position") { - parsing( - """WITH GRAPHS foo >> bar - |RETURN foo GRAPHS bar - """.stripMargin) shouldVerify { result: SemanticCheckResult => - - result.errorMessages should equal( - Set("`foo` already declared as graph") - ) - } - } - - test("using normal variable in graph position") { - parsing( - """WITH 1 AS a GRAPHS foo >> bar - |RETURN GRAPHS a - """.stripMargin) shouldVerify { result: SemanticCheckResult => - - result.errorMessages should equal( - Set("`a` already declared as variable") - ) - } - } - - test("using normal variable in graph definition") { - parsing( - """WITH 1 AS a GRAPHS foo >> bar - |WITH GRAPH a - |RETURN GRAPHS a - """.stripMargin) shouldVerify { result: SemanticCheckResult => - - result.errorMessages should equal( - Set("`a` already declared as variable") - ) - } - - } - - test("persist graph") { - parsing( - """WITH GRAPHS foo >> bar - |PERSIST GRAPH foo TO 'url' - |RETURN GRAPHS bar - """.stripMargin) shouldVerify { result: SemanticCheckResult => - - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,DiscardCardinality(),GraphReturnItems(false,List(NewContextGraphs(GraphAs(Variable(foo),Some(Variable(foo)),false),Some(GraphAs(Variable(bar),Some(Variable(bar)),false))))),None,None,None,None),line 1, column 1 (offset: 0)) - |foo >> bar - |// (Persist(GraphAs(Variable(foo),Some(Variable(foo)),false),GraphUrl(Right(StringLiteral(url)))),line 2, column 22 (offset: 44)) - |foo >> bar - |// (Return(false,DiscardCardinality(),Some(GraphReturnItems(false,List(ReturnedGraph(GraphAs(Variable(bar),Some(Variable(bar)),false))))),None,None,None,Set()),line 3, column 1 (offset: 50)) - |-- - |// End""" - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | GRAPH bar: 19 - | GRAPH foo: 12 - | } - | { /* foo >> bar */ - | GRAPH bar: 19 64 - | GRAPH foo: 12 37 - | } - | { - | GRAPH bar: 64 - | } - |}""" - } - } - - test("relocate graph") { - parsing( - """WITH GRAPHS foo >> bar - |RELOCATE GRAPH foo TO 'url' - |RETURN GRAPHS bar - """.stripMargin) shouldVerify { result: SemanticCheckResult => - - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,DiscardCardinality(),GraphReturnItems(false,List(NewContextGraphs(GraphAs(Variable(foo),Some(Variable(foo)),false),Some(GraphAs(Variable(bar),Some(Variable(bar)),false))))),None,None,None,None),line 1, column 1 (offset: 0)) - |foo >> bar - |// (Relocate(GraphAs(Variable(foo),Some(Variable(foo)),false),GraphUrl(Right(StringLiteral(url)))),line 2, column 23 (offset: 45)) - |foo >> bar - |// (Return(false,DiscardCardinality(),Some(GraphReturnItems(false,List(ReturnedGraph(GraphAs(Variable(bar),Some(Variable(bar)),false))))),None,None,None,Set()),line 3, column 1 (offset: 51)) - |-- - |// End""" - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | GRAPH bar: 19 - | GRAPH foo: 12 - | } - | { /* foo >> bar */ - | GRAPH bar: 19 65 - | GRAPH foo: 12 38 - | } - | { - | GRAPH bar: 65 - | } - |}""" - } - } - - test("delete graphs") { - parsing( - """WITH GRAPHS foo >> bar - |DELETE GRAPHS foo, bar - |RETURN 1 - """.stripMargin) shouldVerify { result: SemanticCheckResult => - - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,DiscardCardinality(),GraphReturnItems(false,List(NewContextGraphs(GraphAs(Variable(foo),Some(Variable(foo)),false),Some(GraphAs(Variable(bar),Some(Variable(bar)),false))))),None,None,None,None),line 1, column 1 (offset: 0)) - |foo >> bar - |// (DeleteGraphs(List(Variable(foo), Variable(bar))),line 2, column 15 (offset: 37)) - |foo >> bar - |// (Return(false,ReturnItems(false,List(AliasedReturnItem(SignedDecimalIntegerLiteral(1),Variable(1)))),None,None,None,None,Set()),line 3, column 1 (offset: 46)) - |-- - |// End""" - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | GRAPH bar: 19 - | GRAPH foo: 12 - | } - | { /* foo >> bar */ - | GRAPH bar: 19 42 - | GRAPH foo: 12 37 - | } - | { - | 1: 54 - | } - |}""" - } - } - - test("snapshot graph") { - parsing( - """WITH GRAPHS foo >> bar - |SNAPSHOT GRAPH foo TO 'url' - |RETURN 1 - """.stripMargin) shouldVerify { result: SemanticCheckResult => - - result.formattedContexts shouldEqualFixNewlines - """// Start - |-- - |// (With(false,DiscardCardinality(),GraphReturnItems(false,List(NewContextGraphs(GraphAs(Variable(foo),Some(Variable(foo)),false),Some(GraphAs(Variable(bar),Some(Variable(bar)),false))))),None,None,None,None),line 1, column 1 (offset: 0)) - |foo >> bar - |// (Snapshot(GraphAs(Variable(foo),Some(Variable(foo)),false),GraphUrl(Right(StringLiteral(url)))),line 2, column 23 (offset: 45)) - |foo >> bar - |// (Return(false,ReturnItems(false,List(AliasedReturnItem(SignedDecimalIntegerLiteral(1),Variable(1)))),None,None,None,None,Set()),line 3, column 1 (offset: 51)) - |-- - |// End""" - result.formattedScopes shouldEqualFixNewlines - """{ - | { - | GRAPH bar: 19 - | GRAPH foo: 12 - | } - | { /* foo >> bar */ - | GRAPH bar: 19 - | GRAPH foo: 12 38 - | } - | { - | 1: 59 - | } - |}""" - } - } - - implicit class verify(actual: String) { - def shouldEqualFixNewlines(expected: String): Unit = { - StringHelper.RichString(actual.trim.stripMargin).fixNewLines should equal(StringHelper.RichString(expected.trim.stripMargin).fixNewLines) - } - } - - private def fullScopeTree(state: SemanticState): String = state.scopeTree.toStringWithoutId.trim - - import scala.compat.Platform.EOL - - private def contextsByPosition(state: SemanticState): String = { - val astNodes = state.recordedContextGraphs.keyPositionSet ++ state.recordedScopes.keyPositionSet - val keys = astNodes.toSeq.sortBy(x => x._2.offset -> x._1.toString) - val values = keys.map(ast => s"${state.recordedContextGraphs.getOrElse(ast._1, "--")}$EOL// $ast") - val finalContext = state.currentScope.contextGraphs.map(_.toString).getOrElse("--") - s"// Start$EOL${values.mkString(EOL)}$EOL$finalContext$EOL// End" - } - - override def convert(astNode: ast.Statement): SemanticCheckResult = { - val rewritten = PreparatoryRewriting.transform(TestState(astNode), TestContext).statement() - val initialState = SemanticState.clean.withFeatures(SemanticFeature.MultipleGraphs, SemanticFeature.WithInitialQuerySignature) - rewritten.semanticCheck(initialState) - } - - implicit final class RichSemanticCheckResult(val result: SemanticCheckResult) { - def state: SemanticState = result.state - - def errors: Seq[SemanticErrorDef] = result.errors - - def errorMessages: Set[String] = errors.map(_.msg).toSet - - def formattedContexts: String = contextsByPosition(state) - - def formattedScopes: String = fullScopeTree(state) - - // Useful for working on these tests - - def dumpAndExit(): Unit = { - dump() - System.exit(1) - } - - def dumpAndFail(): Unit = { - dump() - fail() - } - - def dumpAndFail(msg: String): Unit = { - dump() - fail(msg) - } - - def dump(): Unit = { - println("\n// *** ERRORS") - println(errorMessages.mkString("\n")) - println("\n// *** CONTEXTS") - println(contextsByPosition(state)) - println("\n// *** SCOPES") - println(fullScopeTree(state)) - } - } - - //noinspection TypeAnnotation - case class TestState(override val statement: ast.Statement) extends BaseState { - override def queryText: String = statement.toString - - override def startPosition: None.type = None - - override object plannerName extends PlannerName { - override def name: String = "Test" - - override def version: String = "3.4" - - override def toTextOutput: String = name - } - - override def maybeStatement = None - - override def maybeSemantics = None - - override def maybeExtractedParams = None - - override def maybeSemanticTable = None - - override def accumulatedConditions = Set.empty - - override def withStatement(s: Statement) = copy(s) - - override def withSemanticTable(s: SemanticTable) = ??? - - override def withSemanticState(s: SemanticState) = ??? - - override def withParams(p: Map[String, Any]) = ??? - - override def initialFields: Map[String, CypherType] = Map.empty - } - - //noinspection TypeAnnotation - object TestContext extends BaseContext { - override def tracer = CompilationPhaseTracer.NO_TRACING - - override def notificationLogger = mock[InternalNotificationLogger] - - override object exceptionCreator extends ((String, InputPosition) => CypherException) { - override def apply(msg: String, pos: InputPosition): CypherException = throw new CypherException() { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]): T = - mapper.internalException(msg, this) - } - } - - override def monitors = mock[Monitors] - - override def errorHandler = _ => () - } - -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/PeriodicCommitHintTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/PeriodicCommitHintTest.scala deleted file mode 100644 index 778c25639dc1d..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/PeriodicCommitHintTest.scala +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.{DummyPosition, InputPosition} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticState -import org.neo4j.cypher.internal.v3_5.expressions._ - -class PeriodicCommitHintTest extends CypherFunSuite with Positional { - test("negative values should fail") { - // Given - val sizePosition: InputPosition = pos - val input = "-1" - val value: SignedIntegerLiteral = SignedDecimalIntegerLiteral(input)(sizePosition) - val hint = PeriodicCommitHint(Some(value))(pos) - - // When - val result = hint.semanticCheck(SemanticState.clean) - - // Then - assert(result.errors.size === 1) - assert(result.errors.head.msg === s"Commit size error - expected positive value larger than zero, got ${input}") - assert(result.errors.head.position === sizePosition) - } - - test("no periodic commit size is ok") { - // Given - val hint = PeriodicCommitHint(None)(pos) - - // When - val result = hint.semanticCheck(SemanticState.clean) - - // Then - assert(result.errors.size === 0) - } - - test("positive values are OK") { - // Given - val sizePosition: InputPosition = pos - val input = "1" - val value: SignedIntegerLiteral = SignedDecimalIntegerLiteral(input)(sizePosition) - val hint = PeriodicCommitHint(Some(value))(pos) - - // When - val result = hint.semanticCheck(SemanticState.clean) - - // Then - assert(result.errors.size === 0) - } - - test("queries with periodic commit and no updates are not OK") { - // Given USING PERIODIC COMMIT RETURN "Hello World!" - - val value: SignedIntegerLiteral = SignedDecimalIntegerLiteral("1")(pos) - val periodicCommitPos: InputPosition = pos - val hint = PeriodicCommitHint(Some(value))(periodicCommitPos) - val literal: StringLiteral = StringLiteral("Hello world!")(pos) - val returnItem = UnaliasedReturnItem(literal, "Hello world!")(pos) - val returnItems = ReturnItems(includeExisting = false, Seq(returnItem))(pos) - val returns: Return = Return(distinct = false, returnItems, None, None, None, None)(pos) - val queryPart = SingleQuery(Seq(returns))(pos) - val query = Query(Some(hint), queryPart)(pos) - - // When - val result = query.semanticCheck(SemanticState.clean) - - // Then - assert(result.errors.size === 1) - assert(result.errors.head.msg === "Cannot use periodic commit in a non-updating query") - assert(result.errors.head.position === periodicCommitPos) - } - - test("queries with periodic commit and updates are OK") { - - // Given USING PERIODIC COMMIT CREATE () - - val value: SignedIntegerLiteral = SignedDecimalIntegerLiteral("1")(pos) - val hint = PeriodicCommitHint(Some(value))(pos) - val nodePattern = NodePattern(None,Seq.empty,None)(pos) - val pattern = Pattern(Seq(EveryPath(nodePattern)))(pos) - val create = Create(pattern)(pos) - val queryPart = SingleQuery(Seq(create))(pos) - val query = Query(Some(hint), queryPart)(pos) - - // When - val result = query.semanticCheck(SemanticState.clean) - - // Then - assert(result.errors.size === 0) - } -} - -trait Positional { - var currentPos = 0 - def pos = { - currentPos += 1 - DummyPosition(currentPos) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ProjectionClauseTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ProjectionClauseTest.scala deleted file mode 100644 index 0482c4a997040..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ProjectionClauseTest.scala +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticState -import org.neo4j.cypher.internal.v3_5.expressions._ - -class ProjectionClauseTest extends CypherFunSuite with AstConstructionTestSupport { - - test("should introduce variables into scope") { - // GIVEN WITH "a" as n - val returnItem = AliasedReturnItem(StringLiteral("a")_, varFor("n"))_ - val listedReturnItems = ReturnItems(includeExisting = false, Seq(returnItem))_ - val withObj = With(distinct = false, listedReturnItems, PassAllGraphReturnItems(pos), None, None, None, None)_ - - // WHEN - val beforeState = SemanticState.clean.newChildScope - val middleState = withObj.semanticCheck(beforeState).state - val result = withObj.semanticCheckContinuation(middleState.currentScope.scope)(middleState.newSiblingScope) - - // THEN - result.errors shouldBe empty - result.state.symbolTypes("n") should equal(CTString.invariant) - } - - test("should remove variables from scope") { - // GIVEN n WITH "a" as X - val returnItem = AliasedReturnItem(StringLiteral("a")_, varFor("X"))_ - val listedReturnItems = ReturnItems(includeExisting = false, Seq(returnItem))_ - val withObj = With(distinct = false, listedReturnItems, PassAllGraphReturnItems(pos), None, None, None, None)_ - - val beforeState = SemanticState.clean.newChildScope.declareVariable(varFor("n"), CTNode).right.get - val middleState = withObj.semanticCheck(beforeState).state - val result = withObj.semanticCheckContinuation(middleState.currentScope.scope)(middleState.newSiblingScope) - - // WHEN - val tree = result.state.scopeTree - - // THEN the n variable is no longer accessible - result.errors shouldBe empty - result.state.symbol("n") shouldBe empty - } - - test("test order by scoping") { - // GIVEN MATCH n WITH n AS X ORDER BY X.prop1, X.prop2 - val orderBy: OrderBy = OrderBy(Seq( - AscSortItem(Property(varFor("X"), PropertyKeyName("prop1")_)_)_, - AscSortItem(Property(varFor("X"), PropertyKeyName("prop2")_)_)_ - ))_ - - val returnItem = AliasedReturnItem(varFor("n"), varFor("X"))_ - val listedReturnItems = ReturnItems(includeExisting = false, Seq(returnItem))_ - val withObj = With(distinct = false, listedReturnItems, PassAllGraphReturnItems(pos), Some(orderBy), None, None, None)_ - - // WHEN - val beforeState = SemanticState.clean.newChildScope.declareVariable(varFor("n"), CTNode).right.get - val middleState = withObj.semanticCheck(beforeState).state - val result = withObj.semanticCheckContinuation(middleState.currentScope.scope)(middleState.newSiblingScope) - - // THEN the n variable is no longer accessible - result.errors shouldBe empty - result.state.symbol("n") shouldBe empty - result.state.symbol("X") shouldNot be(empty) - } - - test("test order by scoping 2") { - // GIVEN MATCH n WITH n.prop AS introducedVariable ORDER BY introducedVariable + 2 - val orderBy: OrderBy = OrderBy(Seq( - AscSortItem(Add(varFor("introducedVariable"), SignedDecimalIntegerLiteral("2")_)_)_ - ))_ - - val returnItem = AliasedReturnItem(Property(varFor("n"), PropertyKeyName("prop")_)_, varFor("introducedVariable"))_ - val listedReturnItems = ReturnItems(includeExisting = false, Seq(returnItem))_ - val withObj = With(distinct = false, listedReturnItems, PassAllGraphReturnItems(pos), Some(orderBy), None, None, None)_ - - // WHEN - val beforeState = SemanticState.clean.newChildScope.declareVariable(varFor("n"), CTNode).right.get - val middleState = withObj.semanticCheck(beforeState).state - val result = withObj.semanticCheckContinuation(middleState.currentScope.scope)(middleState.newSiblingScope) - - // THEN the n variable should be an integer - result.errors shouldBe empty - result.state.symbol("introducedVariable") shouldNot be(empty) - } - - test("test order by scoping & shadowing 2") { - // GIVEN MATCH n WITH n AS n ORDER BY n + 2 - val orderBy: OrderBy = OrderBy(Seq( - AscSortItem(Add(varFor("n"), SignedDecimalIntegerLiteral("2")_)_)_ - ))_ - - val returnItem = AliasedReturnItem(varFor("n"), varFor("n"))_ - val listedReturnItems = ReturnItems(includeExisting = false, Seq(returnItem))_ - val withObj = With(distinct = false, listedReturnItems, PassAllGraphReturnItems(pos), Some(orderBy), None, None, None)_ - - // WHEN - val beforeState = SemanticState.clean.newChildScope.declareVariable(varFor("n"), CTNode).right.get - val middleState = withObj.semanticCheck(beforeState).state - val result = withObj.semanticCheckContinuation(middleState.currentScope.scope)(middleState.newSiblingScope) - - // THEN the n variable should be an integer - result.errors shouldNot be(empty) - } - - test("WITH * allowed when no variables in scope") { - // GIVEN CREATE () WITH * CREATE () - val withObj = With(distinct = false, ReturnItems(includeExisting = true, Seq())_, PassAllGraphReturnItems(pos), None, None, None, None)_ - - // WHEN - val beforeState = SemanticState.clean.newChildScope - val middleState = withObj.semanticCheck(beforeState).state - val result = withObj.semanticCheckContinuation(middleState.currentScope.scope)(middleState.newSiblingScope) - - // THEN the n variable should be an integer - result.errors should be(empty) - } - - test("RETURN * not allowed when no variables in scope") { - // GIVEN CREATE () WITH * CREATE () - val withObj = Return(distinct = false, ReturnItems(includeExisting = true, Seq())_, None, None, None, None)_ - - // WHEN - val beforeState = SemanticState.clean.newChildScope - val result = withObj.semanticCheck(beforeState) - - // THEN - result.errors shouldNot be(empty) - } - - test("Aggregating queries remove variables from scope") { - // GIVEN MATCH n WITH n.prop as x, count(*) ORDER BY n.bar - val orderBy: OrderBy = OrderBy(Seq( - AscSortItem(Property(varFor("n"), PropertyKeyName("bar")_)_)_ - ))_ - - val returnItems: Seq[AliasedReturnItem] = Seq( - AliasedReturnItem(Property(varFor("n"), PropertyKeyName("prop")_)_, varFor("x"))_, - AliasedReturnItem(CountStar()_, varFor("count"))_ - ) - val listedReturnItems = ReturnItems(includeExisting = false, returnItems)_ - val withObj = With(distinct = false, listedReturnItems, PassAllGraphReturnItems(pos), Some(orderBy), None, None, None)_ - - // WHEN - val beforeState = SemanticState.clean.newChildScope.declareVariable(varFor("n"), CTNode).right.get - val middleState = withObj.semanticCheck(beforeState).state - val result = withObj.semanticCheckContinuation(middleState.currentScope.scope)(middleState.newSiblingScope) - - // THEN - result.errors shouldNot be(empty) - } - - test("order by a property that isn't projected") { - // GIVEN MATCH n WITH n.prop as x ORDER BY n.bar - val orderBy: OrderBy = OrderBy(Seq( - AscSortItem(Property(varFor("n"), PropertyKeyName("bar")_)_)_ - ))_ - - val returnItems: Seq[AliasedReturnItem] = Seq( - AliasedReturnItem(Property(varFor("n"), PropertyKeyName("prop")_)_, varFor("x"))_ - ) - val listedReturnItems = ReturnItems(includeExisting = false, returnItems)_ - val withObj = With(distinct = false, listedReturnItems, PassAllGraphReturnItems(pos), Some(orderBy), None, None, None)_ - - // WHEN - val beforeState = SemanticState.clean.newChildScope.declareVariable(varFor("n"), CTNode).right.get - val middleState = withObj.semanticCheck(beforeState).state - val result = withObj.semanticCheckContinuation(middleState.currentScope.scope)(middleState.newSiblingScope) - - // THEN - result.errors should be(empty) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ReturnItemsTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ReturnItemsTest.scala deleted file mode 100644 index f150f8e7f5432..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/ReturnItemsTest.scala +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticState -import org.neo4j.cypher.internal.v3_5.expressions.StringLiteral - -class ReturnItemsTest extends CypherFunSuite with AstConstructionTestSupport { - - test("should forbid aliased projections collisions, e.g., projecting more than one value to the same id") { - val item1 = AliasedReturnItem(StringLiteral("a")_, varFor("n"))_ - val item2 = AliasedReturnItem(StringLiteral("b")_, varFor("n"))_ - - val items = ReturnItems(includeExisting = false, Seq(item1, item2))_ - - val result = items.semanticCheck(SemanticState.clean) - - result.errors should have size 1 - result.errors.head.msg should startWith("Multiple result columns with the same name are not supported") - } - - test("should forbid unaliased projections collisions, e.g., projecting more than one value to the same id") { - val item1 = UnaliasedReturnItem(StringLiteral("a")_, "a")_ - val item2 = UnaliasedReturnItem(StringLiteral("a")_, "a")_ - - val items = ReturnItems(includeExisting = false, Seq(item1, item2))_ - - val result = items.semanticCheck(SemanticState.clean) - - result.errors should have size 1 - result.errors.head.msg should startWith("Multiple result columns with the same name are not supported") - } - - test("should not forbid aliased projections of the same expression with different names") { - val item1 = AliasedReturnItem(StringLiteral("a")_, varFor("n"))_ - val item2 = AliasedReturnItem(StringLiteral("a")_, varFor("m"))_ - - val items = ReturnItems(includeExisting = false, Seq(item1, item2))_ - - val result = items.semanticCheck(SemanticState.clean) - - result.errors shouldBe empty - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/SetClauseTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/SetClauseTest.scala deleted file mode 100644 index 23ec6404e87c5..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/SetClauseTest.scala +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticFunSuite, SemanticState} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{DummyExpression, Property, PropertyKeyName} - -class SetClauseTest extends SemanticFunSuite { - - test("shouldHaveMergedTypesOfAllAlternativesInSimpleCase") { - - val mapLiteral = DummyExpression(CTMap) - val property = Property(mapLiteral, PropertyKeyName("key")(DummyPosition(3)))(DummyPosition(5)) - val setItem = SetPropertyItem(property, DummyExpression(CTAny))(DummyPosition(42)) - val setClause = SetClause(Seq(setItem))(DummyPosition(6)) - - - val result = setClause.semanticCheck(SemanticState.clean) - - result.errors should have size 1 - result.errors.head.msg should startWith("Type mismatch: expected Node or Relationship but was Map") - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/SingleGraphTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/SingleGraphTest.scala deleted file mode 100644 index d9b4bd07b1f0f..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/SingleGraphTest.scala +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticFeature, SemanticState} - -class SingleGraphTest extends CypherFunSuite with AstConstructionTestSupport { - - test("Self alias does not produce a semantic error") { - - val Right(state) = SemanticState.clean.withFeatures(SemanticFeature.MultipleGraphs).declareGraph(varFor("foo")) - - val result = graphAs("foo", "foo").semanticCheck(state) - val errors = result.errors.toSet - - errors.isEmpty should be(true) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/StatementReturnColumnsTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/StatementReturnColumnsTest.scala deleted file mode 100644 index bf95bc3e0c1ff..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/StatementReturnColumnsTest.scala +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.frontend.v3_5.parser.{CypherParser, ParserTest} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite - -class StatementReturnColumnsTest extends CypherFunSuite with ParserTest[Statement, List[String]] { - - override def convert(statement: Statement): List[String] = statement.returnColumns - - implicit val parserToTest = CypherParser.Statement - - test("MATCH ... RETURN ...") { - parsing("MATCH (n) RETURN n, n.prop AS m") shouldGive List("n", "m") - parsing("MATCH (n) WITH 1 AS x RETURN x") shouldGive List("x") - } - - test("UNION") { - parsing("MATCH (n) RETURN n UNION MATCH (n) RETURN n") shouldGive List("n") - parsing("MATCH (n) RETURN n UNION ALL MATCH (n) RETURN n") shouldGive List("n") - } - - test("CALL ... YIELD ...") { - parsing("CALL foo YIELD x, y") shouldGive List("x", "y") - parsing("CALL foo YIELD x, y AS z") shouldGive List("x", "z") - } - - test("Updates") { - parsing("MATCH (n) CREATE ()") shouldGive List.empty - parsing("MATCH (n) CREATE UNIQUE ()") shouldGive List.empty - parsing("MATCH (n) SET n.prop=12") shouldGive List.empty - parsing("MATCH (n) REMOVE n.prop") shouldGive List.empty - parsing("MATCH (n) DELETE (m)") shouldGive List.empty - parsing("MATCH (n) MERGE (m:Person {name: 'Stefan'}) ON MATCH SET n.happy = 100") shouldGive List.empty - parsing("MATCH (n) FOREACH (m IN [1,2,3] | CREATE())") shouldGive List.empty - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/TestExpression.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/TestExpression.scala deleted file mode 100644 index 85f14f14781b2..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/ast/TestExpression.scala +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.ast - -import org.neo4j.cypher.internal.frontend.v3_5.SemanticCheck -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticError -import org.neo4j.cypher.internal.util.v3_5.symbols.TypeSpec -import org.neo4j.cypher.internal.util.v3_5.{DummyPosition, InputPosition} -import org.neo4j.cypher.internal.v3_5.expressions.Expression -import org.neo4j.cypher.internal.v3_5.expressions.Expression.SemanticContext - -case class ErrorExpression( - error: SemanticError, - possibleTypes: TypeSpec, - position: InputPosition = DummyPosition(0) - ) extends Expression - -case class CustomExpression( - semanticCheck: (SemanticContext, CustomExpression) => SemanticCheck, - position: InputPosition = DummyPosition(0) - ) extends Expression diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/NonEmptyListTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/NonEmptyListTest.scala deleted file mode 100644 index 8a683212b9910..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/NonEmptyListTest.scala +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.helpers - -import org.neo4j.cypher.internal.util.v3_5.{Fby, Last, NonEmptyList} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite - -class NonEmptyListTest extends CypherFunSuite { - - import NonEmptyList._ - - test("Should construct NonEmptyLists") { - NonEmptyList(1) should equal(Last(1)) - NonEmptyList(1, 2) should equal(Fby(1, Last(2))) - } - - test("Should build NonEmptyLists") { - val builder = NonEmptyList.newBuilder[Int] - - builder.result() should equal(None) - - builder += 1 - - builder.result() should equal(Some(NonEmptyList(1))) - - builder += 2 - - builder.result() should equal(Some(NonEmptyList(1, 2))) - - builder.clear() - - builder.result() should equal(None) - } - - test("Should construct builders via canBuildFrom") { - canBuildFrom(Seq(1)).result() should equal(None) - (canBuildFrom(Seq(1)) += 2).result() should equal(Some(NonEmptyList(2))) - - val result = Seq(1, 2, 3).map(_.toString): Option[NonEmptyList[String]] - result should equal(Some(NonEmptyList("1", "2", "3"))) - } - - test("Should convert to NonEmptyList") { - Seq().toNonEmptyListOption should equal(None) - Seq(1).toNonEmptyListOption should equal(Some(Last(1))) - Seq(1, 2).toNonEmptyListOption should equal(Some(Fby(1, Last(2)))) - } - - test("Should convert from NonEmptyList") { - NonEmptyList(1).toIndexedSeq should equal(Seq(1)) - NonEmptyList(1).toSet should equal(Set(1)) - NonEmptyList(1).toIterable.toArray should equal(Array(1)) - - NonEmptyList(1, 2, 2).toIndexedSeq should equal(Seq(1, 2, 2)) - NonEmptyList(1, 2, 2).toSet should equal(Set(1, 2)) - NonEmptyList(1, 2, 2).toIterable.toArray should equal(Array(1, 2, 2)) - } - - test("Should inspect single element NonEmptyList") { - NonEmptyList(1).head should equal(1) - NonEmptyList(1).tailOption should equal(None) - NonEmptyList(1).hasTail should be(right = false) - NonEmptyList(1).isLast should be(right = true) - } - - test("Should inspect multi element NonEmptyList") { - NonEmptyList(1, 2).head should equal(1) - NonEmptyList(1, 2).tailOption should equal(Some(NonEmptyList(2))) - NonEmptyList(1, 2).hasTail should be(right = true) - NonEmptyList(1, 2).isLast should be(right = false) - } - - test("Should prepend single element to NonEmptyLists") { - 2 +: NonEmptyList(1) should equal(NonEmptyList(2, 1)) - } - - test("should append single element to NonEmptyLists") { - NonEmptyList(1) :+ 2 should equal(NonEmptyList(1, 2)) - } - - test("should append single element to longer NonEmptyLists") { - NonEmptyList(1, 3, 4, 5, 6) :+ 2 should equal(NonEmptyList(1, 3, 4, 5, 6, 2)) - } - - test("Should map and prepend reversed to NonEmptyList") { - NonEmptyList(2, 3).mapAndPrependReversedTo[Int, Int](_ + 1, NonEmptyList(1)) should equal(NonEmptyList(4, 3, 1)) - NonEmptyList(2, 3).mapAndPrependReversedTo[Int, Int](_ + 1, NonEmptyList(1, 2)) should equal(NonEmptyList(4, 3, 1, 2)) - NonEmptyList(2).mapAndPrependReversedTo[Int, Int](_ + 1, NonEmptyList(1, 2)) should equal(NonEmptyList(3, 1, 2)) - NonEmptyList(2).mapAndPrependReversedTo[Int, Int](_ + 1, NonEmptyList(1)) should equal(NonEmptyList(3, 1)) - } - - test("Should prepend multiple elements to NonEmptyLists") { - Seq(2, 3).iterator ++: NonEmptyList(1) should equal(NonEmptyList(2, 3, 1)) - Seq(2, 3) ++: NonEmptyList(1) should equal(NonEmptyList(2, 3, 1)) - Seq(2) ++: NonEmptyList(1) should equal(NonEmptyList(2, 1)) - Seq(2) ++: NonEmptyList(1, 4) should equal(NonEmptyList(2, 1, 4)) - Seq(2, 3, 5) ++: NonEmptyList(1, 4) should equal(NonEmptyList(2, 3, 5, 1, 4)) - } - - test("Should concatenate NonEmptyLists") { - (NonEmptyList(1) ++ NonEmptyList(4)) should equal(NonEmptyList(1, 4)) - (NonEmptyList(1) ++ NonEmptyList(4, 5 ,6)) should equal(NonEmptyList(1, 4, 5, 6)) - (NonEmptyList(1, 2, 3) ++ NonEmptyList(4)) should equal(NonEmptyList(1, 2, 3, 4)) - (NonEmptyList(1, 2, 3) ++ NonEmptyList(4, 5 ,6)) should equal(NonEmptyList(1, 2, 3, 4, 5, 6)) - } - - test("Should support foreach on NonEmptyLists") { - var count = 0 - - NonEmptyList(1).foreach { _ => count += 1 } - - count should equal(1) - - NonEmptyList(1, 2, 3, 4).foreach { _ => count += 2 } - - count should equal(9) - } - - test("Should support filtering a NonEmptyList") { - NonEmptyList(1).filter(_ == 0) should equal(None) - NonEmptyList(1).filter(_ == 1) should equal(Some(NonEmptyList(1))) - - NonEmptyList(1, 2).filter(_ == 0) should equal(None) - NonEmptyList(1, 3).filter(_ <= 2) should equal(Some(NonEmptyList(1))) - NonEmptyList(1, 2).filter(_ >= 0) should equal(Some(NonEmptyList(1, 2))) - } - - test("Should map NonEmptyList") { - NonEmptyList(1).map(_ + 1) should equal(NonEmptyList(2)) - NonEmptyList(1, 2).map(_ + 1) should equal(NonEmptyList(2, 3)) - } - - test("Should collect from a NonEmptyList") { - NonEmptyList(1).collect { case x if x == 1 => "Apa" } should equal(Some(NonEmptyList("Apa"))) - NonEmptyList(1, 2).collect { case x if x == 1 => "Apa" } should equal(Some(NonEmptyList("Apa"))) - NonEmptyList(1).collect { case x if x != 1 => "Apa" } should equal(None) - NonEmptyList(1, 2).collect { case x if x != 1 => "Apa" } should equal(Some(NonEmptyList("Apa"))) - } - - test("Should reverseFlatMap a NonEmptyList") { - NonEmptyList(1).reverseFlatMap(x => NonEmptyList(x, x + 1)) should equal(NonEmptyList(2, 1)) - NonEmptyList(1, 4).reverseFlatMap(x => NonEmptyList(x, x + 1)) should equal(NonEmptyList(5, 4, 2, 1)) - NonEmptyList(1, 4, 8).reverseFlatMap(x => NonEmptyList(x, x + 1)) should equal(NonEmptyList(9, 8, 5, 4, 2, 1)) - } - - test("Should flatMap a NonEmptyList") { - NonEmptyList(1).flatMap(x => NonEmptyList(x, x + 1)) should equal(NonEmptyList(1, 2)) - NonEmptyList(1, 4).flatMap(x => NonEmptyList(x, x + 1)) should equal(NonEmptyList(1, 2, 4, 5)) - NonEmptyList(1, 4, 8).flatMap(x => NonEmptyList(x, x + 1)) should equal(NonEmptyList(1, 2, 4, 5, 8, 9)) - } - - test("Should fold left over a NonEmptyList") { - NonEmptyList(1).foldLeft(Seq.empty[Int])(_ :+ _) should equal(Seq(1)) - NonEmptyList(1, 2).foldLeft(Seq.empty[Int])(_ :+ _) should equal(Seq(1, 2)) - } - - test("Should left reduce a NonEmptyList") { - NonEmptyList(23).reduceLeft(_ + _) should equal(23) - NonEmptyList(42, 23).reduceLeft(_ - _) should equal(19) - NonEmptyList(42, 23, 10).reduceLeft(_ - _) should equal(9) - } - - test("Should group a NonEmptyList by a key for each element") { - NonEmptyList(1).groupBy((x: Int) => x / 2) should equal(Map(0 -> NonEmptyList(1))) - NonEmptyList(1, 2).groupBy((x: Int) => x / 2) should equal(Map(0 -> NonEmptyList(1), 1 -> NonEmptyList(2))) - NonEmptyList(1, 2, 3).groupBy((x: Int) => x / 2) should equal(Map(0 -> NonEmptyList(1), 1 -> NonEmptyList(2, 3))) - } - - test("Should find min in a NonEmptyList") { - NonEmptyList(1).min should equal(1) - NonEmptyList(1, 2).min should equal(1) - NonEmptyList(4, 1, 2).min should equal(1) - NonEmptyList(4, 1).min should equal(1) - } - - test("Should find max in a NonEmptyList") { - NonEmptyList(10).max should equal(10) - NonEmptyList(10, 2).max should equal(10) - NonEmptyList(4, 10, 2).max should equal(10) - NonEmptyList(4, 10).max should equal(10) - } - - test("Should partition a NonEmptyList") { - NonEmptyList(1).partition { x => if (x == 1) Left(x) else Right(x) } should equal(Left(NonEmptyList(1) -> None)) - NonEmptyList(1).partition { x => if (x != 1) Left(x) else Right(x) } should equal(Right(None -> NonEmptyList(1))) - - NonEmptyList(1, 2, 3).partition { x => if (x == 1) Left(x) else Right(x) } should equal(Left(NonEmptyList(1) -> Some(NonEmptyList(2, 3)))) - NonEmptyList(1, 2, 3).partition { x => if (x != 1) Left(x) else Right(x) } should equal(Right(Some(NonEmptyList(2, 3)) -> NonEmptyList(1))) - - NonEmptyList(1, 2, 3).partition { x => if (x != 0) Left(x) else Right(x) } should equal(Left(NonEmptyList(1, 2, 3) -> None)) - NonEmptyList(1, 2, 3).partition { x => if (x == 0) Left(x) else Right(x) } should equal(Right(None -> NonEmptyList(1, 2, 3))) - } - - test("exists should work as expected") { - NonEmptyList(1).exists(_ == 2) should be(false) - NonEmptyList(1).exists(_ == 1) should be(true) - NonEmptyList(1, 2, 3).exists(_ == 4) should be(false) - NonEmptyList(1, 2, 3).exists(_ < 4) should be(true) - NonEmptyList(1, 2, 3).exists(_ >= 3) should be(true) - } - - test("forall should work as expected") { - NonEmptyList(1).forall(_ == 2) should be(false) - NonEmptyList(1).forall(_ == 1) should be(true) - NonEmptyList(1, 2, 3).forall(_ == 4) should be(false) - NonEmptyList(1, 2, 3).forall(_ < 4) should be(true) - NonEmptyList(1, 2, 3).forall(_ >= 3) should be(false) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/StatementHelper.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/StatementHelper.scala deleted file mode 100644 index b43ff893409eb..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/StatementHelper.scala +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.helpers - -import org.neo4j.cypher.internal.frontend.v3_5.ast.Statement -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{Scope, SemanticCheckResult, SemanticFeature, SemanticState} -import org.scalatest.Assertions - -object StatementHelper extends Assertions { - - implicit class RichStatement(ast: Statement) { - def semanticState(features: SemanticFeature*): SemanticState = - ast.semanticCheck(SemanticState.clean.withFeatures(features: _*)) match { - case SemanticCheckResult(state, errors) => - if (errors.isEmpty) { - state - } else - fail(s"Failure during semantic checking of $ast with errors $errors") - } - - def scope: Scope = semanticState().scopeTree - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/StringHelperTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/StringHelperTest.scala deleted file mode 100644 index afc65148b3db0..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/StringHelperTest.scala +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.helpers - -import org.apache.commons.lang3.SystemUtils -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite - -class StringHelperTest extends CypherFunSuite { - - import StringHelper._ - - test("should not fix position when the text contains no line break") { - val text = "(line 1, column 8 (offset: 7))" - - text.fixPosition should equal("(line 1, column 8 (offset: 7))") - } - - test("should fix positions on Windows after line breaks") { - val text = "(line 3, column 8 (offset: 7))" - - if (SystemUtils.IS_OS_WINDOWS) { - text.fixPosition should equal("(line 3, column 8 (offset: 9))") - } else { - text.fixPosition should equal("(line 3, column 8 (offset: 7))") - } - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterStepSequencerTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterStepSequencerTest.scala deleted file mode 100644 index 8ed15de106d5b..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/helpers/rewriting/RewriterStepSequencerTest.scala +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting - -import org.neo4j.cypher.internal.util.v3_5.Rewriter -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite - -class RewriterStepSequencerTest extends CypherFunSuite { - - test("if no conditions are used, what goes in is what comes out") { - val dummyRewriter1 = Rewriter.noop - val dummyRewriter2 = Rewriter.lift { case x: AnyRef => x } - - RewriterStepSequencer.newValidating("test")() should equal(RewriterContract(Seq(), Set())) - RewriterStepSequencer.newValidating("test")(ApplyRewriter("1", dummyRewriter1), ApplyRewriter("2", dummyRewriter2)) should equal(RewriterContract(Seq(dummyRewriter1, dummyRewriter2), Set())) - } - - test("Should enable conditions between rewriters and collect the post conditions at the end") { - val dummyCond1 = RewriterCondition("a", (x: Any) => Seq("1")) - val dummyCond2 = RewriterCondition("b", (x: Any) => Seq("2")) - val dummyRewriter1 = Rewriter.noop - val dummyRewriter2 = Rewriter.lift { case x: AnyRef => x } - - val sequencer = RewriterStepSequencer.newValidating("test")( - ApplyRewriter("1", dummyRewriter1), - EnableRewriterCondition(dummyCond1), - ApplyRewriter("2", dummyRewriter2), - EnableRewriterCondition(dummyCond2) - ) - - sequencer.childRewriters should equal(Seq( - dummyRewriter1, - RunConditionRewriter("test", Some("1"), Set(dummyCond1)), - dummyRewriter2, - RunConditionRewriter("test", Some("2"), Set(dummyCond1, dummyCond2)) - )) - sequencer.postConditions should equal(Set(dummyCond1, dummyCond2)) - } - - test("Should enable/disable conditions between rewriters and collect the post conditions at the end") { - val dummyCond1 = RewriterCondition("a", (x: Any) => Seq("1")) - val dummyCond2 = RewriterCondition("b", (x: Any) => Seq("2")) - val dummyRewriter1 = Rewriter.noop - val dummyRewriter2 = Rewriter.lift { case x: AnyRef => x} - val dummyRewriter3 = Rewriter.noop - - val sequencer = RewriterStepSequencer.newValidating("test")( - ApplyRewriter("1", dummyRewriter1), - EnableRewriterCondition(dummyCond1), - ApplyRewriter("2", dummyRewriter2), - EnableRewriterCondition(dummyCond2), - ApplyRewriter("3", dummyRewriter3), - DisableRewriterCondition(dummyCond2) - ) - - sequencer.childRewriters should equal(Seq( - dummyRewriter1, - RunConditionRewriter("test", Some("1"), Set(dummyCond1)), - dummyRewriter2, - RunConditionRewriter("test", Some("2"), Set(dummyCond1, dummyCond2)), - dummyRewriter3, - RunConditionRewriter("test", Some("3"), Set(dummyCond1)) - )) - sequencer.postConditions should equal(Set(dummyCond1)) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/BaseRulesTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/BaseRulesTest.scala deleted file mode 100644 index cbac8f9895cde..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/BaseRulesTest.scala +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.parboiled.scala._ - -class BaseRulesTest extends ParserTest[Any, Any] with Base { - - test("testWhitespaceHandling") { - implicit val parserToTest: Rule1[Boolean] = "a" ~ WS ~ "b" ~ push(true) - - parsing("a b") shouldGive true - parsing("a b") shouldGive true - } - - def convert(result: Any): Any = result -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ComparisonTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ComparisonTest.scala deleted file mode 100644 index 624c576904756..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ComparisonTest.scala +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.v3_5.{expressions => exp} - -class ComparisonTest extends ParserAstTest[exp.Expression] with Expressions { - implicit val parser = Expression - - test("a < b") { - yields(lt(id("a"), id("b"))) - } - - test("a > b") { - yields(gt(id("a"), id("b"))) - } - - test("a > b AND b > c") { - yields(and(gt(id("a"), id("b")), gt(id("b"), id("c")))) - } - - test("a > b > c") { - yields(ands(gt(id("a"), id("b")), gt(id("b"), id("c")))) - } - - test("a > b > c > d") { - yields(ands(gt(id("a"), id("b")), gt(id("b"), id("c")), gt(id("c"), id("d")))) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/FunctionInvocationParserTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/FunctionInvocationParserTest.scala deleted file mode 100644 index 589de7816e5db..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/FunctionInvocationParserTest.scala +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.v3_5.{expressions => exp} - -class FunctionInvocationParserTest - extends ParserAstTest[exp.FunctionInvocation] - with Expressions - with Literals - with Base - with ProcedureCalls { - - implicit val parser = FunctionInvocation - - test("foo()") { - yields(exp.FunctionInvocation(exp.Namespace()(pos), exp.FunctionName("foo")(pos), distinct = false, Vector.empty)) - } - - test("foo('test', 1 + 2)") { - yields(exp.FunctionInvocation(exp.Namespace()(pos), exp.FunctionName("foo")(pos), distinct = false, Vector( - exp.StringLiteral("test")(pos), - exp.Add( - exp.SignedDecimalIntegerLiteral("1")(pos), - exp.SignedDecimalIntegerLiteral("2")(pos))(pos) - ))) - } - test("my.namespace.foo()") { - yields(exp.FunctionInvocation(exp.Namespace(List("my", "namespace"))(pos), exp.FunctionName("foo")(pos), distinct = false, Vector.empty)) - } - - test("my.namespace.foo('test', 1 + 2)") { - yields(exp.FunctionInvocation(exp.Namespace(List("my", "namespace"))(pos), exp.FunctionName("foo")(pos), distinct = false, Vector( - exp.StringLiteral("test")(pos), - exp.Add( - exp.SignedDecimalIntegerLiteral("1")(pos), - exp.SignedDecimalIntegerLiteral("2")(pos))(pos) - ))) - } - - - private val pos = DummyPosition(-1) - - implicit class StringToVariable(string: String) { - def asVar = id(string)(pos) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/GraphReturnItemsParserTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/GraphReturnItemsParserTest.scala deleted file mode 100644 index 37f5a7e56d1ec..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/GraphReturnItemsParserTest.scala +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.frontend.v3_5.ast -import org.neo4j.cypher.internal.frontend.v3_5.ast.AstConstructionTestSupport - -import scala.language.implicitConversions - -class GraphReturnItemsParserTest - extends ParserAstTest[ast.GraphReturnItems] - with Graphs - with Expressions - with AstConstructionTestSupport { - - implicit val parser = GraphReturnItems - - test("must start with GRAPH or GRAPHS") { - assertFails("foo, GRAPH a") - } - - test("GRAPH foo >>") { - yields(ast.GraphReturnItems(includeExisting = false, List( - ast.NewContextGraphs(graph("foo"))(pos) - ))) - } - - test(">> GRAPH bar") { - yields(ast.GraphReturnItems(includeExisting = false, List( - ast.NewTargetGraph(graph("bar"))(pos) - ))) - } - - test("GRAPH foo >> GRAPH bar") { - yields(ast.GraphReturnItems(includeExisting = false, List( - ast.NewContextGraphs(graph("foo"), Some(graph("bar")))(pos) - ))) - } - - test("GRAPH a, GRAPH foo >> GRAPH bar, GRAPH b") { - yields(ast.GraphReturnItems(includeExisting = false, List( - ast.ReturnedGraph(graph("a"))(pos), - ast.NewContextGraphs(graph("foo"), Some(graph("bar")))(pos), - ast.ReturnedGraph(graph("b"))(pos) - ))) - } - - test("GRAPH baz, GRAPH foo >>, GRAPH bar") { - yields(ast.GraphReturnItems(includeExisting = false, List( - ast.ReturnedGraph(graph("baz"))(pos), - ast.NewContextGraphs(graph("foo"))(pos), - ast.ReturnedGraph(graph("bar"))(pos) - ))) - } - - test("GRAPH foo, >> GRAPH bar, GRAPH baz") { - yields(ast.GraphReturnItems(includeExisting = false, List( - ast.ReturnedGraph(graph("foo"))(pos), - ast.NewTargetGraph(graph("bar"))(pos), - ast.ReturnedGraph(graph("baz"))(pos) - ))) - } - - // graphs list - - test("GRAPHS foo >>") { - yields(ast.GraphReturnItems(includeExisting = false, List( - ast.NewContextGraphs(graph("foo"))(pos) - ))) - } - - test("GRAPHS >> bar") { - yields(ast.GraphReturnItems(includeExisting = false, List( - ast.NewTargetGraph(graph("bar"))(pos) - ))) - } - - test("GRAPHS foo >> bar") { - yields(ast.GraphReturnItems(includeExisting = false, List( - ast.NewContextGraphs(graph("foo"), Some(graph("bar")))(pos) - ))) - } - - test("GRAPHS a, foo >> bar, b") { - yields(ast.GraphReturnItems(includeExisting = false, List( - ast.ReturnedGraph(graph("a"))(pos), - ast.NewContextGraphs(graph("foo"), Some(graph("bar")))(pos), - ast.ReturnedGraph(graph("b"))(pos) - ))) - } - - test("GRAPHS baz, foo >>, bar") { - yields(ast.GraphReturnItems(includeExisting = false, List( - ast.ReturnedGraph(graph("baz"))(pos), - ast.NewContextGraphs(graph("foo"))(pos), - ast.ReturnedGraph(graph("bar"))(pos) - ))) - } - - test("GRAPHS foo, >> bar, baz") { - yields(ast.GraphReturnItems(includeExisting = false, List( - ast.ReturnedGraph(graph("foo"))(pos), - ast.NewTargetGraph(graph("bar"))(pos), - ast.ReturnedGraph(graph("baz"))(pos) - ))) - } - - test("GRAPH AT 'url' AS foo >>") { - yields(ast.GraphReturnItems(includeExisting = false, List( - ast.NewContextGraphs(graphAt("foo", "url"), None)(pos) - ))) - } - - test("GRAPH foo, >> GRAPH AT 'url2' AS bar") { - yields(ast.GraphReturnItems(includeExisting = false, List( - ast.ReturnedGraph(graph("foo"))(pos), - ast.NewTargetGraph(graphAt("bar", "url2"))(pos) - ))) - } - - // graphs star list - - test("GRAPHS *, foo >>") { - yields(ast.GraphReturnItems(includeExisting = true, List( - ast.NewContextGraphs(graph("foo"))(pos) - ))) - } - - test("GRAPHS *, >> bar") { - yields(ast.GraphReturnItems(includeExisting = true, List( - ast.NewTargetGraph(graph("bar"))(pos) - ))) - } - - test("GRAPHS *, foo >> bar") { - yields(ast.GraphReturnItems(includeExisting = true, List( - ast.NewContextGraphs(graph("foo"), Some(graph("bar")))(pos) - ))) - } - - test("GRAPHS *, a, foo >> bar, b") { - yields(ast.GraphReturnItems(includeExisting = true, List( - ast.ReturnedGraph(graph("a"))(pos), - ast.NewContextGraphs(graph("foo"), Some(graph("bar")))(pos), - ast.ReturnedGraph(graph("b"))(pos) - ))) - } - - // combo list - - test("GRAPHS baz, foo >> GRAPH AT 'url' AS bar") { - yields(ast.GraphReturnItems(includeExisting = false, List( - ast.ReturnedGraph(graph("baz"))(pos), - ast.NewContextGraphs(graph("foo"), Some(graphAt("bar", "url")))(pos) - ))) - } - - test("GRAPHS foo, GRAPH AT 'url' AS moep >> bar, baz") { - yields(ast.GraphReturnItems(includeExisting = false, List( - ast.ReturnedGraph(graph("foo"))(pos), - ast.NewContextGraphs(graphAt("moep", "url"), Some(graph("bar")))(pos), - ast.ReturnedGraph(graph("baz"))(pos) - ))) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/GraphsParserTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/GraphsParserTest.scala deleted file mode 100644 index aa97358804b81..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/GraphsParserTest.scala +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.util.v3_5.{DummyPosition, InputPosition} -import org.neo4j.cypher.internal.frontend.v3_5.ast -import org.neo4j.cypher.internal.v3_5.{expressions => exp} -import org.parboiled.scala.Rule1 - -import scala.language.implicitConversions - -class GraphsParserTest - extends ParserAstTest[ast.SingleGraphAs] - with Graphs - with Expressions { - - implicit val parser: Rule1[ast.SingleGraphAs] = SingleGraph - - test("SOURCE GRAPH") { - yields(ast.SourceGraphAs(None)) - } - - test("SOURCE GRAPH AS foo") { - yields(ast.SourceGraphAs(Some(v("foo")))) - } - - test("TARGET GRAPH") { - yields(ast.TargetGraphAs(None)) - } - - test("TARGET GRAPH AS foo") { - yields(ast.TargetGraphAs(Some(v("foo")))) - } - - test("GRAPH foo") { - yields(ast.GraphAs(v("foo"), None)) - } - - test("GRAPH foo AS bar") { - yields(ast.GraphAs(v("foo"), Some(v("bar")))) - } - - test("GRAPH AT 'url'") { - yields(ast.GraphAtAs(url("url"), None)) - } - - test("GRAPH AT 'url' AS foo") { - yields(ast.GraphAtAs(url("url"), Some(v("foo")))) - } - - test("GRAPH OF ()") { - yields(ast.GraphOfAs(nodePattern, None)) - } - - test("GRAPH OF p=(), q=()") { - yields(ast.GraphOfAs(complexPattern, None)) - } - - test("GRAPH OF () AS foo") { - yields(ast.GraphOfAs(nodePattern, Some(v("foo")))) - } - - test("GRAPH OF p=(), q=() AS foo") { - yields(ast.GraphOfAs(complexPattern, Some(v("foo")))) - } - - test("GRAPH foo AT 'url'") { - yields(ast.GraphAtAs(url("url"), Some(v("foo")))) - } - - test("GRAPH foo OF ()") { - yields(ast.GraphOfAs(nodePattern, Some(v("foo")))) - } - - private def url(addr: String): ast.GraphUrl = ast.GraphUrl(Right(exp.StringLiteral(addr)(pos)))(pos) - private implicit val pos: InputPosition = DummyPosition(-1) - private val nodePattern = exp.Pattern(List(exp.EveryPath(exp.NodePattern(None, List(), None)(pos))))(pos) - private val complexPattern = exp.Pattern(List( - exp.NamedPatternPart(v("p"), exp.EveryPath(exp.NodePattern(None, List(), None)(pos)))(pos), - exp.NamedPatternPart(v("q"), exp.EveryPath(exp.NodePattern(None, List(), None)(pos)))(pos) - ))(pos) - private implicit def v(name: String): exp.Variable = exp.Variable(name)(pos) -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/LiteralsTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/LiteralsTest.scala deleted file mode 100644 index 96abd300a8e9c..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/LiteralsTest.scala +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.{expressions => ast} -import org.parboiled.scala._ - -class LiteralsTest extends ParserTest[Any, Any] with Literals { - - def Expression: Rule1[ast.Expression] = ??? - val t = DummyPosition(0) - - test("test variable can contain ascii") { - implicit val parserToTest = Variable - - parsing("abc") shouldGive ast.Variable("abc")(t) - parsing("a123") shouldGive ast.Variable("a123")(t) - parsing("ABC") shouldGive ast.Variable("ABC")(t) - parsing("_abc") shouldGive ast.Variable("_abc")(t) - parsing("abc_de") shouldGive ast.Variable("abc_de")(t) - } - - test("test variable can contain utf8") { - implicit val parserToTest = Variable - - parsing("aé") shouldGive ast.Variable("aé")(t) - parsing("⁔") shouldGive ast.Variable("⁔")(t) - parsing("_test") shouldGive ast.Variable("_test")(t) - parsing("a_test") shouldGive ast.Variable("a_test")(t) - } - - test("test variable name can not start with number") { - implicit val parserToTest = Variable - - assertFails("1bcd") - } - - test("can parse numbers") { - implicit val parserToTest = NumberLiteral - - parsing("123") shouldGive ast.SignedDecimalIntegerLiteral("123")(t) - parsing("0") shouldGive ast.SignedDecimalIntegerLiteral("0")(t) - parsing("-23") shouldGive ast.SignedDecimalIntegerLiteral("-23")(t) - parsing("-0") shouldGive ast.SignedDecimalIntegerLiteral("-0")(t) - - parsing("0234") shouldGive ast.SignedOctalIntegerLiteral("0234")(t) - parsing("-0234") shouldGive ast.SignedOctalIntegerLiteral("-0234")(t) - - parsing("0x1") shouldGive ast.SignedHexIntegerLiteral("0x1")(t) - parsing("0xffff") shouldGive ast.SignedHexIntegerLiteral("0xffff")(t) - parsing("-0x45FG") shouldGive ast.SignedHexIntegerLiteral("-0x45FG")(t) - - parsing("1.23") shouldGive ast.DecimalDoubleLiteral("1.23")(t) - parsing("13434.23399") shouldGive ast.DecimalDoubleLiteral("13434.23399")(t) - parsing(".3454") shouldGive ast.DecimalDoubleLiteral(".3454")(t) - parsing("-0.0") shouldGive ast.DecimalDoubleLiteral("-0.0")(t) - parsing("-54366.4") shouldGive ast.DecimalDoubleLiteral("-54366.4")(t) - parsing("-0.3454") shouldGive ast.DecimalDoubleLiteral("-0.3454")(t) - - parsing("1E23") shouldGive ast.DecimalDoubleLiteral("1E23")(t) - parsing("1.34E99") shouldGive ast.DecimalDoubleLiteral("1.34E99")(t) - parsing("9E-443") shouldGive ast.DecimalDoubleLiteral("9E-443")(t) - } - - test("can parse legacy parameter syntax") { - implicit val parserToTest = Parameter - - parsing("{p}") shouldGive ast.Parameter("p", CTAny)(t) - parsing("{`the funny horse`}") shouldGive ast.Parameter("the funny horse", CTAny)(t) - parsing("{0}") shouldGive ast.Parameter("0", CTAny)(t) - } - - test("can parse new parameter syntax") { - implicit val parserToTest = Parameter - - parsing("$p") shouldGive ast.Parameter("p", CTAny)(t) - parsing("$`the funny horse`") shouldGive ast.Parameter("the funny horse", CTAny)(t) - parsing("$0") shouldGive ast.Parameter("0", CTAny)(t) - } - - test("variables are not allowed to start with currency symbols") { - implicit val parserToTest = Variable - - Seq("$", "¢", "£", "₲", "₶", "\u20BD", "$", "﹩").foreach { curr => - assertFails(s"${curr}var") - } - } - - def convert(result: Any): Any = result -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/MultipleGraphClausesParsingTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/MultipleGraphClausesParsingTest.scala deleted file mode 100644 index ad4bf9de5d343..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/MultipleGraphClausesParsingTest.scala +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.frontend.v3_5.ast -import org.neo4j.cypher.internal.v3_5.{expressions => exp} -import org.neo4j.cypher.internal.frontend.v3_5.ast.{AstConstructionTestSupport, Clause} -import org.parboiled.scala.Rule1 - -import scala.language.implicitConversions - -class MultipleGraphClausesParsingTest - extends ParserAstTest[ast.Clause] - with Query - with Expressions - with AstConstructionTestSupport { - - implicit val parser: Rule1[Clause] = Clause - - test("CREATE GRAPH foo AT 'url'") { - yields(ast.CreateRegularGraph(snapshot = false, varFor("foo"), None, url("url"))) - } - - test("CREATE SNAPSHOT GRAPH foo AT 'url'") { - yields(ast.CreateRegularGraph(snapshot = true, varFor("foo"), None, url("url"))) - } - - test("CREATE GRAPH foo OF () AT 'url'") { - yields(ast.CreateRegularGraph(snapshot = false, varFor("foo"), Some(nodePattern), url("url"))) - } - - test("CREATE SNAPSHOT GRAPH foo OF () AT 'url'") { - yields(ast.CreateRegularGraph(snapshot = true, varFor("foo"), Some(nodePattern), url("url"))) - } - - test("CREATE GRAPH foo OF p=(), q=() AT 'url'") { - yields(ast.CreateRegularGraph(snapshot = false, varFor("foo"), Some(complexPattern), url("url"))) - } - - test("CREATE SNAPSHOT GRAPH foo OF p=(), q=() AT 'url'") { - yields(ast.CreateRegularGraph(snapshot = true, varFor("foo"), Some(complexPattern), url("url"))) - } - - test("CREATE >> GRAPH foo AT 'url'") { - yields(ast.CreateNewTargetGraph(snapshot = false, varFor("foo"), None, url("url"))) - } - - test("CREATE >> SNAPSHOT GRAPH foo AT 'url'") { - yields(ast.CreateNewTargetGraph(snapshot = true, varFor("foo"), None, url("url"))) - } - - test("CREATE GRAPH foo AT 'url' >>") { - yields(ast.CreateNewSourceGraph(snapshot = false, varFor("foo"), None, url("url"))) - } - - test("CREATE SNAPSHOT GRAPH foo AT 'url' >>") { - yields(ast.CreateNewSourceGraph(snapshot = true, varFor("foo"), None, url("url"))) - } - - test("PERSIST GRAPH foo TO 'url'") { - yields(ast.Persist(graph("foo"), url("url"))) - } - - test("PERSIST SOURCE GRAPH TO 'url'") { - yields(ast.Persist(ast.SourceGraphAs(None)(pos), url("url"))) - } - - test("PERSIST TARGET GRAPH TO 'url'") { - yields(ast.Persist(ast.TargetGraphAs(None)(pos), url("url"))) - } - - test("SNAPSHOT GRAPH foo TO 'url'") { - yields(ast.Snapshot(graph("foo"), url("url"))) - } - - test("SNAPSHOT SOURCE GRAPH TO 'url'") { - yields(ast.Snapshot(ast.SourceGraphAs(None)(pos), url("url"))) - } - - test("SNAPSHOT TARGET GRAPH TO 'url'") { - yields(ast.Snapshot(ast.TargetGraphAs(None)(pos), url("url"))) - } - - test("RELOCATE GRAPH foo TO 'url'") { - yields(ast.Relocate(graph("foo"), url("url"))) - } - - test("DELETE GRAPHS foo, bar") { - yields(ast.DeleteGraphs(Seq(varFor("foo"), varFor("bar")))) - } - - test("DELETE GRAPH foo") { - yields(ast.DeleteGraphs(Seq(varFor("foo")))) - } - - test("DELETE GRAPH foo, GRAPH bar") { - yields(ast.DeleteGraphs(Seq(varFor("foo"), varFor("bar")))) - } - - private val nodePattern = exp.Pattern(List(exp.EveryPath(exp.NodePattern(None, List(), None)(pos))))(pos) - - private val complexPattern = exp.Pattern(List( - exp.NamedPatternPart(varFor("p"), exp.EveryPath(exp.NodePattern(None, List(), None)(pos)))(pos), - exp.NamedPatternPart(varFor("q"), exp.EveryPath(exp.NodePattern(None, List(), None)(pos)))(pos) - ))(pos) -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/MultipleGraphsParserTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/MultipleGraphsParserTest.scala deleted file mode 100644 index cfd5c2954677a..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/MultipleGraphsParserTest.scala +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.frontend.v3_5.ast -import org.neo4j.cypher.internal.frontend.v3_5.ast.{AstConstructionTestSupport, PassAllGraphReturnItems} -import org.parboiled.scala.Rule1 - -class MultipleGraphsParserTest - extends ParserAstTest[ast.Query] - with Query - with Expressions - with AstConstructionTestSupport { - - implicit val parser: Rule1[ast.Query] = Query - - test("WITH *") { - yields(ast.Query(None, ast.SingleQuery(Seq(ast.With(ast.ReturnItems(includeExisting = true, Seq.empty)(pos), PassAllGraphReturnItems(pos))(pos)))(pos))) - } - - test("WITH 1 AS a WITH a GRAPHS foo, >> GRAPH AT 'url2' AS bar RETURN GRAPHS bar, foo") { - yields(ast.Query(None, ast.SingleQuery(Seq( - ast.With( - ast.ReturnItems(includeExisting = false, Seq(ast.AliasedReturnItem(literalInt(1), varFor("a"))(pos)))(pos), - PassAllGraphReturnItems(pos) - )(pos), ast.With( - ast.ReturnItems(includeExisting = false, Seq(ast.UnaliasedReturnItem(varFor("a"), "a")(pos)))(pos), - ast.GraphReturnItems(includeExisting = false, Seq(ast.ReturnedGraph(graph("foo"))(pos), ast.NewTargetGraph(graphAt("bar", "url2"))(pos)))(pos) - )(pos), ast.Return( - ast.GraphReturnItems(includeExisting = false, Seq(ast.ReturnedGraph(graph("bar"))(pos), ast.ReturnedGraph(graph("foo"))(pos)))(pos) - )(pos) - ))(pos))) - } - - test("WITH 1 AS a WITH a GRAPH AT 'url' AS foo >> foo WITH a GRAPHS foo, >> GRAPH AT 'url2' AS bar RETURN GRAPHS bar, foo") { - yields(ast.Query(None, ast.SingleQuery(Seq( - ast.With( - ast.ReturnItems(includeExisting = false, Seq(ast.AliasedReturnItem(literalInt(1), varFor("a"))(pos)))(pos), - PassAllGraphReturnItems(pos) - )(pos), ast.With( - ast.ReturnItems(includeExisting = false, Seq(ast.UnaliasedReturnItem(varFor("a"), "a")(pos)))(pos), - ast.GraphReturnItems(includeExisting = false, Seq(ast.NewContextGraphs(graphAt("foo", "url"), Some(graph("foo")))(pos)))(pos) - )(pos), ast.With( - ast.ReturnItems(includeExisting = false, Seq(ast.UnaliasedReturnItem(varFor("a"), "a")(pos)))(pos), - ast.GraphReturnItems(includeExisting = false, Seq(ast.ReturnedGraph(graph("foo"))(pos), ast.NewTargetGraph(graphAt("bar", "url2"))(pos)))(pos) - )(pos), ast.Return( - ast.GraphReturnItems(includeExisting = false, Seq(ast.ReturnedGraph(graph("bar"))(pos), ast.ReturnedGraph(graph("foo"))(pos)))(pos) - )(pos) - ))(pos))) - } - - test("WITH 1 AS a WITH a GRAPH AT 'url' AS foo >> WITH a GRAPHS foo, >> GRAPH AT 'url2' AS bar RETURN GRAPHS bar, foo") { - yields(ast.Query(None, ast.SingleQuery(Seq( - ast.With( - ast.ReturnItems(includeExisting = false, Seq(ast.AliasedReturnItem(literalInt(1), varFor("a"))(pos)))(pos), - PassAllGraphReturnItems(pos) - )(pos), ast.With( - ast.ReturnItems(includeExisting = false, Seq(ast.UnaliasedReturnItem(varFor("a"), "a")(pos)))(pos), - ast.GraphReturnItems(includeExisting = false, Seq(ast.NewContextGraphs(graphAt("foo", "url"))(pos)))(pos) - )(pos), ast.With( - ast.ReturnItems(includeExisting = false, Seq(ast.UnaliasedReturnItem(varFor("a"), "a")(pos)))(pos), - ast.GraphReturnItems(includeExisting = false, Seq(ast.ReturnedGraph(graph("foo"))(pos), ast.NewTargetGraph(graphAt("bar", "url2"))(pos)))(pos) - )(pos), ast.Return( - ast.GraphReturnItems(includeExisting = false, Seq(ast.ReturnedGraph(graph("bar"))(pos), ast.ReturnedGraph(graph("foo"))(pos)))(pos) - )(pos) - ))(pos))) - } - -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ParserAstTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ParserAstTest.scala deleted file mode 100644 index 2f1aa4785dbac..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ParserAstTest.scala +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.util.v3_5.test_helpers.TestName -import org.neo4j.cypher.internal.v3_5.{expressions => exp} -import org.parboiled.scala._ - -trait ParserAstTest[AST] extends ParserTest[AST, AST] with TestName { - final override def convert(ast: AST): AST = ast - - final def yields(expr: (InputPosition) => AST)(implicit parser: Rule1[AST]): Unit = parsing(testName) shouldGive expr - - final def failsToParse(implicit parser: Rule1[AST]): Unit = assertFails(testName) - - private type Expression = (InputPosition) => exp.Expression - - final def id(id: String): (InputPosition) => exp.Variable = exp.Variable(id)(_) - - final def lt(lhs: Expression, rhs: Expression): Expression = { pos => exp.LessThan(lhs(pos), rhs(pos))(pos) } - - final def lte(lhs: Expression, rhs: Expression): Expression = { pos => exp.LessThanOrEqual(lhs(pos), rhs(pos))(pos) } - - final def gt(lhs: Expression, rhs: Expression): Expression = { pos => exp.GreaterThan(lhs(pos), rhs(pos))(pos) } - - final def gte(lhs: Expression, rhs: Expression): Expression = { pos => exp.GreaterThanOrEqual(lhs(pos), rhs(pos))(pos) } - - final def eq(lhs: Expression, rhs: Expression): Expression = { pos => exp.Equals(lhs(pos), rhs(pos))(pos) } - - final def ne(lhs: Expression, rhs: Expression): Expression = { pos => exp.NotEquals(lhs(pos), rhs(pos))(pos) } - - final def and(lhs: Expression, rhs: Expression): Expression = { pos => exp.And(lhs(pos), rhs(pos))(pos) } - - final def ands(parts: Expression*): Expression = { pos => exp.Ands(parts.map(_(pos)).toSet)(pos) } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ParserTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ParserTest.scala deleted file mode 100644 index fe6414ad4b2de..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ParserTest.scala +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.parboiled.errors.InvalidInputError -import org.parboiled.scala._ - -trait ParserTest[T, J] extends CypherFunSuite { - - def convert(astNode: T): J - - class ResultCheck(val actuals: Seq[J], text: String) { - - def or(other: ResultCheck) = new ResultCheck(actuals ++ other.actuals, text) - - def shouldGive(expected: J) { - actuals foreach { - actual => - actual should equal(expected) - } - } - - def shouldGive(expected: ((InputPosition) => J)) { - shouldGive(expected(InputPosition(0,0,0))) - } - - def shouldMatch(expected: PartialFunction[J, Unit]) { - actuals foreach { - actual => expected.isDefinedAt(actual) should equal(true) - } - } - - def shouldVerify(expected: J => Unit): Unit = { - actuals foreach expected - } - - override def toString: String = s"ResultCheck( $text -> $actuals )" - } - - def parsing(s: String)(implicit p: Rule1[T]): ResultCheck = convertResult(parseRule(p ~ EOI, s), s) - - def partiallyParsing(s: String)(implicit p: Rule1[T]): ResultCheck = convertResult(parseRule(p, s), s) - - def assertFails(s: String)(implicit p: Rule1[T]) { - parseRule(p ~ EOI, s).result match { - case None => - case Some(thing) => fail(s"'$s' should not have been parsed correctly, parsed as $thing") - } - } - - private def parseRule(rule: Rule1[T], text: String): ParsingResult[T] = - ReportingParseRunner(rule).run(text) - - private def convertResult(r: ParsingResult[T], input: String) = r.result match { - case Some(t) => new ResultCheck(Seq(convert(t)), input) - case None => fail(s"'$input' failed with: " + r.parseErrors.map { - case error: InvalidInputError => - val position = BufferPosition(error.getInputBuffer, error.getStartIndex) - val message = new InvalidInputErrorFormatter().format(error) - s"$message ($position)" - case error => - error.getClass.getSimpleName - }.mkString(",")) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ProcedureCallParserTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ProcedureCallParserTest.scala deleted file mode 100644 index e589b47a94781..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ProcedureCallParserTest.scala +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.frontend.v3_5.ast -import org.neo4j.cypher.internal.v3_5.{expressions => exp} - -class ProcedureCallParserTest - extends ParserAstTest[ast.UnresolvedCall] - with Expressions - with Literals - with Base - with ProcedureCalls { - - implicit val parser = Call - - test("CALL foo") { - yields(ast.UnresolvedCall(exp.Namespace()(pos), exp.ProcedureName("foo")(pos))) - } - - test("CALL foo()") { - yields(ast.UnresolvedCall(exp.Namespace()(pos), exp.ProcedureName("foo")(pos), Some(Seq.empty))) - } - - test("CALL foo('Test', 1+2)") { - yields(ast.UnresolvedCall(exp.Namespace()(pos), exp.ProcedureName("foo")(pos), - Some(Vector( - exp.StringLiteral("Test")(pos), - exp.Add( - exp.SignedDecimalIntegerLiteral("1")(pos), - exp.SignedDecimalIntegerLiteral("2")(pos))(pos) - ))) - ) - } - - test("CALL foo.bar.baz('Test', 1+2)") { - yields(ast.UnresolvedCall(exp.Namespace(List("foo", "bar"))(pos), exp.ProcedureName("baz")(pos), - Some(Vector( - exp.StringLiteral("Test")(pos), - exp.Add( - exp.SignedDecimalIntegerLiteral("1")(pos), - exp.SignedDecimalIntegerLiteral("2")(pos))(pos) - ))) - ) - } - - test("CALL foo YIELD bar") { - yields(ast.UnresolvedCall(exp.Namespace()(pos), exp.ProcedureName("foo")(pos), None, Some(ast.ProcedureResult.from - (result("bar"))(pos)))) - } - - test("CALL foo YIELD bar, baz") { - yields(ast.UnresolvedCall(exp.Namespace()(pos), exp.ProcedureName("foo")(pos), None, Some(ast.ProcedureResult.from - (result("bar"), result("baz"))(pos)))) - } - - test("CALL foo() YIELD bar") { - yields(ast.UnresolvedCall(exp.Namespace()(pos), exp.ProcedureName("foo")(pos), Some(Seq.empty), Some - (ast.ProcedureResult.from(result("bar"))(pos)))) - } - - test("CALL foo() YIELD bar, baz") { - yields(ast.UnresolvedCall(exp.Namespace()(pos), exp.ProcedureName("foo")(pos), Some(Seq.empty), Some - (ast.ProcedureResult.from(result("bar"), result("baz"))(pos)))) - } - - private def result(name: String): ast.ProcedureResultItem = - ast.ProcedureResultItem(exp.Variable(name)(pos))(pos) - - private def result(output: String, name: String): ast.ProcedureResultItem = - ast.ProcedureResultItem(exp.ProcedureOutput(output)(pos), exp.Variable(name)(pos))(pos) - - private implicit val pos = DummyPosition(-1) - - implicit class StringToVariable(string: String) { - def asVar = id(string)(pos) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ProjectionClauseParserTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ProjectionClauseParserTest.scala deleted file mode 100644 index 752a306ae17b5..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/parser/ProjectionClauseParserTest.scala +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.parser - -import org.neo4j.cypher.internal.frontend.v3_5.ast -import org.neo4j.cypher.internal.frontend.v3_5.ast.{AstConstructionTestSupport, Clause, GraphReturnItems, PassAllGraphReturnItems} -import org.parboiled.scala.Rule1 - -class ProjectionClauseParserTest - extends ParserAstTest[ast.Clause] - with Query - with Expressions - with AstConstructionTestSupport { - - implicit val parser: Rule1[Clause] = Clause - - test("WITH *") { - yields(ast.With(ast.ReturnItems(includeExisting = true, Seq.empty)(pos), PassAllGraphReturnItems(pos))) - } - - test("WITH 1 AS a") { - yields(ast.With(ast.ReturnItems(includeExisting = false, Seq(ast.AliasedReturnItem(literalInt(1), varFor("a"))(pos)))(pos), PassAllGraphReturnItems(pos))) - } - - test("WITH *, 1 AS a") { - yields(ast.With(ast.ReturnItems(includeExisting = true, Seq(ast.AliasedReturnItem(literalInt(1), varFor("a"))(pos)))(pos), PassAllGraphReturnItems(pos))) - } - - test("WITH ") { - failsToParse - } - - test("WITH GRAPH *") { - failsToParse - } - - test("WITH * GRAPH AT 'url' AS foo >>") { - yields(ast.With( - ast.ReturnItems(includeExisting = true, Seq.empty)(pos), - ast.GraphReturnItems(includeExisting = false, Seq(ast.NewContextGraphs(graphAt("foo", "url"))(pos)))(pos)) - ) - } - - test("WITH a GRAPHS foo, >> GRAPH AT 'url2' AS bar") { - yields(ast.With( - ast.ReturnItems(includeExisting = false, Seq(ast.UnaliasedReturnItem(varFor("a"), "a")(pos)))(pos), - ast.GraphReturnItems(includeExisting = false, Seq(ast.ReturnedGraph(graph("foo"))(pos), ast.NewTargetGraph(graphAt("bar", "url2"))(pos)))(pos) - )) - } - - test("WITH 1 AS a GRAPH AT 'url' AS foo, GRAPH AT 'url2' AS bar") { - yields(ast.With( - ast.ReturnItems(includeExisting = false, Seq(ast.AliasedReturnItem(literalInt(1), varFor("a"))(pos)))(pos), - ast.GraphReturnItems(includeExisting = false, Seq(ast.ReturnedGraph(graphAt("foo", "url"))(pos), ast.ReturnedGraph(graphAt("bar", "url2"))(pos)))(pos) - )) - } - - ignore("WITH GRAPHS") { - failsToParse - } - - ignore("WITH GRAPH") { - failsToParse - } - - test("WITH GRAPHS a, b") { - val graphs: GraphReturnItems = ast.GraphReturnItems(includeExisting = false, Seq( - ast.ReturnedGraph(ast.GraphAs(varFor("a"), None)(pos))(pos), - ast.ReturnedGraph(ast.GraphAs(varFor("b"), None)(pos))(pos) - ))(pos) - yields(ast.With(graphs)) - } - - test("WITH GRAPHS *, a, b") { - val graphs: GraphReturnItems = ast.GraphReturnItems(includeExisting = true, Seq( - ast.ReturnedGraph(ast.GraphAs(varFor("a"), None)(pos))(pos), - ast.ReturnedGraph(ast.GraphAs(varFor("b"), None)(pos))(pos) - ))(pos) - yields(ast.With(graphs)) - } - - test("WITH 1 AS a GRAPHS *") { - val graphs: GraphReturnItems = ast.GraphReturnItems(includeExisting = true, Seq.empty)(pos) - yields(ast.With(ast.ReturnItems(includeExisting = false, Seq(ast.AliasedReturnItem(literalInt(1), varFor("a"))(pos)))(pos), graphs)) - } - - test("WITH * GRAPHS *") { - val graphs: GraphReturnItems = ast.GraphReturnItems(includeExisting = true, Seq.empty)(pos) - yields(ast.With(ast.ReturnItems(includeExisting = true, Seq.empty)(pos), graphs)) - } - - test("WITH * GRAPH foo AT 'url'") { - val graphs: GraphReturnItems = ast.GraphReturnItems(includeExisting = false, Seq(ast.ReturnedGraph(graphAt("foo", "url"))(pos)))(pos) - yields(ast.With(ast.ReturnItems(includeExisting = true, Seq.empty)(pos), graphs)) - } - - test("WITH * GRAPH foo AT 'url' ORDER BY 2 LIMIT 1") { - val graphs: GraphReturnItems = ast.GraphReturnItems(includeExisting = false, Seq(ast.ReturnedGraph(graphAt("foo", "url"))(pos)))(pos) - yields(ast.With(distinct = false, ast.ReturnItems(includeExisting = true, Seq.empty)(pos), graphs, Some(ast.OrderBy(Seq(ast.AscSortItem(literalInt(2))(pos)))(pos)), None, Some(ast.Limit(literalInt(1))(pos)), None)) - } - - test("RETURN *") { - yields(ast.Return(ast.ReturnItems(includeExisting = true, Seq.empty)(pos), None)) - } - - test("RETURN 1 AS a") { - yields(ast.Return(ast.ReturnItems(includeExisting = false, Seq(ast.AliasedReturnItem(literalInt(1), varFor("a"))(pos)))(pos), None)) - } - - test("RETURN *, 1 AS a") { - yields(ast.Return(ast.ReturnItems(includeExisting = true, Seq(ast.AliasedReturnItem(literalInt(1), varFor("a"))(pos)))(pos), None)) - } - - test("RETURN ") { - failsToParse - } - - test("RETURN GRAPH *") { - failsToParse - } - - ignore("RETURN GRAPHS") { - failsToParse - } - - ignore("RETURN GRAPH") { - failsToParse - } - - test("RETURN GRAPHS a, b") { - val graphs: GraphReturnItems = ast.GraphReturnItems(includeExisting = false, Seq( - ast.ReturnedGraph(ast.GraphAs(varFor("a"), None)(pos))(pos), - ast.ReturnedGraph(ast.GraphAs(varFor("b"), None)(pos))(pos) - ))(pos) - yields(ast.Return(graphs)) - } - - test("RETURN GRAPHS *, a, b") { - val graphs: GraphReturnItems = ast.GraphReturnItems(includeExisting = true, Seq( - ast.ReturnedGraph(ast.GraphAs(varFor("a"), None)(pos))(pos), - ast.ReturnedGraph(ast.GraphAs(varFor("b"), None)(pos))(pos) - ))(pos) - yields(ast.Return(graphs)) - } - - test("RETURN 1 AS a GRAPHS *") { - val graphs: GraphReturnItems = ast.GraphReturnItems(includeExisting = true, Seq.empty)(pos) - yields(ast.Return(ast.ReturnItems(includeExisting = false, Seq(ast.AliasedReturnItem(literalInt(1), varFor("a"))(pos)))(pos), Some(graphs))) - } - - test("RETURN * GRAPHS *") { - val graphs: GraphReturnItems = ast.GraphReturnItems(includeExisting = true, Seq.empty)(pos) - yields(ast.Return(ast.ReturnItems(includeExisting = true, Seq.empty)(pos), Some(graphs))) - } - - test("RETURN * GRAPH foo AT 'url' ORDER BY 2 LIMIT 1") { - val graphs: GraphReturnItems = ast.GraphReturnItems(includeExisting = false, Seq(ast.ReturnedGraph(graphAt("foo", "url"))(pos)))(pos) - yields(ast.Return(distinct = false, ast.ReturnItems(includeExisting = true, Seq.empty)(pos), Some(graphs), Some(ast.OrderBy(Seq(ast.AscSortItem(literalInt(2))(pos)))(pos)), None, Some(ast.Limit(literalInt(1))(pos)))) - } - - test("FROM GRAPH foo AT 'url'") { - val graphs: GraphReturnItems = ast.GraphReturnItems(includeExisting = true, Seq(ast.NewContextGraphs(graphAt("foo", "url"), None)(pos)))(pos) - yields(ast.With(ast.ReturnItems(includeExisting = true, Seq.empty)(pos), graphs)) - } - - test("INTO GRAPH foo AT 'url'") { - val graphs: GraphReturnItems = ast.GraphReturnItems(includeExisting = true, Seq(ast.NewTargetGraph(graphAt("foo", "url"))(pos)))(pos) - yields(ast.With(ast.ReturnItems(includeExisting = true, Seq.empty)(pos), graphs)) - } - -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/prettifier/ExpressionStringifierTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/prettifier/ExpressionStringifierTest.scala deleted file mode 100644 index a4c88b9214c4e..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/prettifier/ExpressionStringifierTest.scala +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.prettifier - -import org.neo4j.cypher.internal.frontend.v3_5.ast.AstConstructionTestSupport -import org.neo4j.cypher.internal.frontend.v3_5.parser.Expressions -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.Expression -import org.parboiled.scala.{Parser, ReportingParseRunner, _} - -class ExpressionStringifierTest - extends CypherFunSuite - with AstConstructionTestSupport with Parser with Expressions { - val stringifier = ExpressionStringifier() - val parser = ReportingParseRunner(Expression) - - val tests: Seq[(String, String)] = - Seq[(String, String)]( - "42" -> "42", - "[1,2,3,4]" -> "[1, 2, 3, 4]", - "1+2" -> "1 + 2", - "(1)+2" -> "1 + 2", - "(1+2)*3" -> "(1 + 2) * 3", - "1+2*3" -> "1 + 2 * 3", - "filter(x in [1,2,3] WHERE x is not null)" -> "filter(x IN [1, 2, 3] WHERE x IS NOT NULL)", - "collect(n)[3]" -> "collect(n)[3]", - "collect(n)[3..4]" -> "collect(n)[3..4]", - "collect(n)[2..]" -> "collect(n)[2..]", - "collect(n)[..2]" -> "collect(n)[..2]", - "[x in [1,2,3] | x * 2]" -> "[x IN [1, 2, 3] | x * 2]", - "[x in [1,2,3]\n\tWHERE x%2=0|x*2]" -> "[x IN [1, 2, 3] WHERE x % 2 = 0 | x * 2]", - "[x in [1,2,3]\n\tWHERE x%2=0]" -> "[x IN [1, 2, 3] WHERE x % 2 = 0]", - "[(a)-->(b)|a.prop]" -> "[(a)-->(b) | a.prop]", - "[p=(a)-->(b) WHERE a:APA|a.prop*size(p)]" -> "[p = (a)-->(b) WHERE a:APA | a.prop * size(p)]", - "n['apa']" -> "n[\"apa\"]", - "'apa'" -> "\"apa\"", - "'a\"pa'" -> "'a\"pa'", - "\"a'pa\"" -> "\"a'pa\"", - "\"a'\\\"pa\"" -> "\"a'\\\"pa\"", - "any(x in ['a','b', 'c'] where x > 28)" -> "any(x IN [\"a\", \"b\", \"c\"] WHERE x > 28)", - "all(x in ['a','b', 'c'] where x > 28)" -> "all(x IN [\"a\", \"b\", \"c\"] WHERE x > 28)", - "none(x in ['a','b', 'c'] where x > 28)" -> "none(x IN [\"a\", \"b\", \"c\"] WHERE x > 28)", - "{k: 'apa', id: 42}" -> "{k: \"apa\", id: 42}", - "()<--()-->()" -> "()<--()-->()", - "()<-[*]-()" -> "()<-[*]-()", - "()<-[*1..]-()" -> "()<-[*1..]-()", - "()<-[*..2]-()" -> "()<-[*..2]-()", - "()<-[*2..4]-()" -> "()<-[*2..4]-()", - "(:Label)<-[var]-({id:43})-->(v:X)" -> "(:Label)<-[var]-({id: 43})-->(v:X)", - "n{.*,.bar,baz:42,variable}" -> "n{.*, .bar, baz: 42, variable}", - "n:A:B" -> "n:A:B", - "not(true)" -> "not true", - "extract(x in [1,2,3] | x * 2)" -> "extract(x IN [1, 2, 3] | x * 2)", - "case when 1 = n.prop then 1 when 2 = n.prop then 2 else 4 end" -> - "case when 1 = n.prop then 1 when 2 = n.prop then 2 else 4 end", - "case n.prop when 1 then '1' when 2 then '2' else '4' end" -> - "case n.prop when 1 then \"1\" when 2 then \"2\" else \"4\" end", - "not(((1) = (2)) and ((3) = (4)))" -> "not (1 = 2 AND 3 = 4)", - "reduce(totalAge = 0, n IN nodes(p)| totalAge + n.age)" -> - "reduce(totalAge = 0, n IN nodes(p) | totalAge + n.age)", - "$param1+{param2}" -> "$param1 + $param2", - "p.name starts with 'Keanu'" -> """p.name STARTS WITH "Keanu"""", - "p.name ends with 'Reeves'" -> """p.name ENDS WITH "Reeves"""" - ) - - tests foreach { - case (inputString, expected) => - test(inputString) { - val parsingResults = parser.run(inputString) - val value1: Expression = parsingResults.result.get - - val str = stringifier(value1) - str should equal(expected) - } - } - -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/prettifier/PrettifierTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/prettifier/PrettifierTest.scala deleted file mode 100644 index cc5d143b980cc..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/prettifier/PrettifierTest.scala +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.prettifier - -import org.neo4j.cypher.internal.frontend.v3_5.ast.Statement -import org.neo4j.cypher.internal.frontend.v3_5.parser.CypherParser -import org.neo4j.cypher.internal.util.v3_5.test_helpers.{CypherFunSuite, WindowsStringSafe} - -class PrettifierTest extends CypherFunSuite { - implicit val windowsSafe = WindowsStringSafe - - val stringifier: Prettifier = Prettifier(ExpressionStringifier()) - - val parser = new CypherParser - val tests: Seq[(String, String)] = - Seq[(String, String)]( - "return 42" -> "RETURN 42", - "return 42 as x" -> "RETURN 42 AS x", - "return 42 as `43`" -> "RETURN 42 AS `43`", - "return distinct 42" -> "RETURN DISTINCT 42", - - "return distinct a, b as X, 3+3 as six order by b.prop, b.foo descending skip 1 limit 2" -> - """RETURN DISTINCT a, b AS X, 3 + 3 AS six - | ORDER BY b.prop ASCENDING, b.foo DESCENDING - | SKIP 1 - | LIMIT 2""".stripMargin, - - "match (a) return a" -> - """MATCH (a) - |RETURN a""".stripMargin, - - "match (a) where a.prop = 42 return a" -> - """MATCH (a) - | WHERE a.prop = 42 - |RETURN a""".stripMargin, - - "match (a) with distinct a, b as X, 3+3 as six order by b.prop, b.foo descending skip 1 limit 2 where true" -> - """MATCH (a) - |WITH DISTINCT a, b AS X, 3 + 3 AS six - | ORDER BY b.prop ASCENDING, b.foo DESCENDING - | SKIP 1 - | LIMIT 2 - | WHERE true""".stripMargin, - - "create (a)--(b) RETURN a" -> - """CREATE (a)--(b) - |RETURN a""".stripMargin, - - "unwind [1,2] as a return a"-> - """UNWIND [1, 2] AS a - |RETURN a""".stripMargin, - - "match(p:Person) where p.name starts with 'Keanu' return p"-> - """MATCH (p:Person) - | WHERE p.name STARTS WITH "Keanu" - |RETURN p""".stripMargin, - - "match(p:Person) where p.name ends with 'Reeves' return p"-> - """MATCH (p:Person) - | WHERE p.name ENDS WITH "Reeves" - |RETURN p""".stripMargin - - ) - - tests foreach { - case (inputString, expected) => - test(inputString) { - val parsingResults: Statement = parser.parse(inputString) - val str = stringifier.asString(parsingResults) - str should equal(expected) - } - } - -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/AddTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/AddTest.scala deleted file mode 100644 index 576603d399f50..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/AddTest.scala +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.Add - -class AddTest extends InfixExpressionTestBase(Add(_, _)(DummyPosition(0))) { - - // Infix specializations: - // "a" + "b" => "ab" - // "a" + 1 => "a1" - // "a" + 1.1 => "a1.1" - // 1 + "b" => "1b" - // 1 + 1 => 2 - // 1 + 1.1 => 2.1 - // 1.1 + "b" => "1.1b" - // 1.1 + 1 => 2.1 - // 1.1 + 1.1 => 2.2 - // [a] + [b] => [a, b] - // [a] + b => [a, b] - // a + [b] => [a, b] - - test("shouldHandleAllSpecializations") { - testValidTypes(CTString, CTString)(CTString) - testValidTypes(CTString, CTInteger)(CTString) - testValidTypes(CTString, CTFloat)(CTString) - testValidTypes(CTInteger, CTString)(CTString) - testValidTypes(CTInteger, CTInteger)(CTInteger) - testValidTypes(CTInteger, CTFloat)(CTFloat) - testValidTypes(CTFloat, CTString)(CTString) - testValidTypes(CTFloat, CTInteger)(CTFloat) - testValidTypes(CTFloat, CTFloat)(CTFloat) - testValidTypes(CTDuration, CTDuration)(CTDuration) - testValidTypes(CTDate, CTDuration)(CTDate) - testValidTypes(CTDuration, CTDate)(CTDate) - testValidTypes(CTTime, CTDuration)(CTTime) - testValidTypes(CTDuration, CTTime)(CTTime) - testValidTypes(CTLocalTime, CTDuration)(CTLocalTime) - testValidTypes(CTDuration, CTLocalTime)(CTLocalTime) - testValidTypes(CTDateTime, CTDuration)(CTDateTime) - testValidTypes(CTDuration, CTDateTime)(CTDateTime) - testValidTypes(CTLocalDateTime, CTDuration)(CTLocalDateTime) - testValidTypes(CTDuration, CTLocalDateTime)(CTLocalDateTime) - - testValidTypes(CTList(CTNode), CTList(CTNode))(CTList(CTNode)) - testValidTypes(CTList(CTFloat), CTList(CTFloat))(CTList(CTFloat)) - - testValidTypes(CTList(CTNode), CTNode)(CTList(CTNode)) - testValidTypes(CTList(CTFloat), CTFloat)(CTList(CTFloat)) - - testValidTypes(CTNode, CTList(CTNode))(CTList(CTNode)) - testValidTypes(CTFloat, CTList(CTFloat))(CTList(CTFloat)) - - testValidTypes(CTList(CTAny), CTList(CTAny))(CTList(CTAny)) - } - - test("should handle covariant types") { - testValidTypes(CTString.covariant, CTString.covariant)(CTString) - testValidTypes(CTString.covariant, CTInteger)(CTString) - testValidTypes(CTString, CTInteger.covariant)(CTString) - testValidTypes(CTInteger.covariant, CTInteger.covariant)(CTInteger) - testValidTypes(CTInteger.covariant, CTFloat)(CTFloat) - testValidTypes(CTInteger, CTFloat.covariant)(CTFloat) - testValidTypes(CTFloat.covariant, CTFloat.covariant)(CTFloat) - - testValidTypes(CTList(CTFloat).covariant, CTList(CTFloat).covariant)(CTList(CTFloat)) - - testValidTypes(CTList(CTNode).covariant, CTNode)(CTList(CTNode)) - testValidTypes(CTList(CTNode), CTNode.covariant)(CTList(CTNode)) - - testValidTypes(CTList(CTAny).covariant, CTList(CTAny).covariant)(CTList(CTAny).covariant) - } - - test("shouldHandleCombinedSpecializations") { - testValidTypes(CTFloat | CTString, CTInteger)(CTFloat | CTString) - testValidTypes(CTFloat | CTList(CTFloat), CTFloat)(CTFloat | CTList(CTFloat)) - testValidTypes(CTFloat, CTFloat | CTList(CTFloat))(CTFloat | CTList(CTFloat)) - } - - test("shouldHandleCoercions") { - testValidTypes(CTList(CTFloat), CTInteger)(CTList(CTFloat)) - testValidTypes(CTFloat | CTList(CTFloat), CTInteger)(CTFloat | CTList(CTFloat)) - } - - test("shouldFailTypeCheckForIncompatibleArguments") { - testInvalidApplication(CTInteger, CTBoolean)( - "Type mismatch: expected Float, Integer, String or List but was Boolean" - ) - testInvalidApplication(CTDuration, CTBoolean)( - "Type mismatch: expected Duration, Date, Time, LocalTime, LocalDateTime, DateTime or List but was Boolean" - ) - } - - test("should concatenate different typed lists") { - testValidTypes(CTList(CTInteger), CTList(CTString))(CTList(CTAny)) - } - - test("should concatenate vector element of other type after list") { - testValidTypes(CTInteger, CTList(CTString))(CTList(CTAny)) - } - - test("should concatenate vector element of other type before list") { - testValidTypes(CTList(CTInteger), CTString)(CTList(CTAny)) - } - - test("should concatenate same typed lists") { - testValidTypes(CTList(CTInteger), CTList(CTInteger))(CTList(CTInteger)) - } - - test("should concatenate nested lists") { - testValidTypes(CTList(CTList(CTInteger)), CTList(CTList(CTInteger)))(CTList(CTList(CTInteger))) - testValidTypes(CTList(CTList(CTInteger)), CTList(CTInteger))(CTList(CTAny)) - testValidTypes(CTList(CTList(CTInteger)), CTInteger)(CTList(CTAny)) - } - - test("should work with ORed types") { - testValidTypes(CTInteger | CTList(CTString), CTList(CTString) | CTInteger)(CTList(CTAny) | CTList(CTString) | CTInteger) - testValidTypes(CTInteger | CTList(CTInteger), CTString)(CTString | CTList(CTAny)) - testValidTypes(CTInteger | CTList(CTInteger), CTBoolean)(CTList(CTAny)) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/AndTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/AndTest.scala deleted file mode 100644 index 2b9daf9b422c5..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/AndTest.scala +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.And - -class AndTest extends InfixExpressionTestBase(And(_, _)(DummyPosition(0))) { - - test("shouldCombineBooleans") { - testValidTypes(CTBoolean, CTBoolean)(CTBoolean) - } - - test("shouldCoerceArguments") { - testInvalidApplication(CTInteger, CTBoolean)("Type mismatch: expected Boolean but was Integer") - testInvalidApplication(CTBoolean, CTInteger)("Type mismatch: expected Boolean but was Integer") - } - - test("shouldReturnErrorIfInvalidArgumentTypes") { - testInvalidApplication(CTNode, CTBoolean)("Type mismatch: expected Boolean but was Node") - testInvalidApplication(CTBoolean, CTNode)("Type mismatch: expected Boolean but was Node") - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ContainerIndexTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ContainerIndexTest.scala deleted file mode 100644 index d2b98b8775b07..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ContainerIndexTest.scala +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{ContainerIndex, DecimalDoubleLiteral, DummyExpression, SignedDecimalIntegerLiteral} - -class ContainerIndexTest extends SemanticFunSuite { - - val dummyString = DummyExpression(CTString) - val dummyInteger = DummyExpression(CTInteger) - val dummyNode = DummyExpression(CTNode) - val dummyAny = DummyExpression(CTAny) - val dummyList = DummyExpression(CTList(CTNode) | CTList(CTString)) - - test("should detect list lookup") { - val lhs = dummyList - val rhs = dummyInteger - val index = ContainerIndex(lhs, rhs)(DummyPosition(10)) - - val result = SemanticExpressionCheck.simple(index)(SemanticState.clean) - result.errors shouldBe empty - assertIsList(types(lhs)(result.state)) - types(rhs)(result.state) should equal(CTInteger.covariant) - types(index)(result.state) should equal(CTNode | CTString) - } - - test("should detect node lookup") { - val lhs = dummyNode - val rhs = dummyString - val index = ContainerIndex(lhs, rhs)(DummyPosition(10)) - - val result = SemanticExpressionCheck.simple(index)(SemanticState.clean) - result.errors shouldBe empty - assertIsMap(types(lhs)(result.state)) - types(rhs)(result.state) should equal(CTString.covariant) - types(index)(result.state) should equal(CTAny.covariant) - } - - test("should type as any if given untyped lookup arguments") { - val lhs = dummyAny - val rhs = dummyAny - val index = ContainerIndex(lhs, rhs)(DummyPosition(10)) - - val result = SemanticExpressionCheck.simple(index)(SemanticState.clean) - result.errors shouldBe empty - types(lhs)(result.state) should equal(CTAny.contravariant) - types(rhs)(result.state) should equal(CTAny.contravariant) - types(index)(result.state) should equal(TypeSpec.all) - } - - test("should return list inner types of expression") { - val index = ContainerIndex(dummyList, - SignedDecimalIntegerLiteral("1")(DummyPosition(5)) - )(DummyPosition(4)) - - val result = SemanticExpressionCheck.simple(index)(SemanticState.clean) - result.errors shouldBe empty - types(index)(result.state) should equal(CTNode | CTString) - } - - test("should raise error if indexing by fraction") { - val index = ContainerIndex(dummyList, - DecimalDoubleLiteral("1.3")(DummyPosition(5)) - )(DummyPosition(4)) - - val result = SemanticExpressionCheck.simple(index)(SemanticState.clean) - result.errors should equal(Seq(SemanticError("Type mismatch: expected Integer but was Float", index.idx.position))) - } - - private def assertIsList(spec: TypeSpec) = { - val intersection = spec & CTList(CTAny).covariant - (intersection == TypeSpec.none) should be(right = false) - spec should equal(intersection) - } - - private def assertIsMap(spec: TypeSpec) = { - val intersection = spec & CTMap.covariant - (intersection == TypeSpec.none) should be(right = false) - spec should equal(intersection) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/DivideTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/DivideTest.scala deleted file mode 100644 index 0bbd9e356b6a0..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/DivideTest.scala +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.Divide - -class DivideTest extends InfixExpressionTestBase(Divide(_, _)(DummyPosition(0))) { - - // Infix specializations: - // 1 / 1 => 1 - // 1 / 1.1 => 0.909 - // 1.1 / 1 => 1.1 - // 1.1 / 1.1 => 1.0 - - test("shouldHandleAllSpecializations") { - testValidTypes(CTInteger, CTInteger)(CTInteger) - testValidTypes(CTInteger, CTFloat)(CTFloat) - testValidTypes(CTFloat, CTInteger)(CTFloat) - testValidTypes(CTFloat, CTFloat)(CTFloat) - testValidTypes(CTDuration, CTFloat)(CTDuration) - testValidTypes(CTDuration, CTInteger)(CTDuration) - } - - test("shouldHandleCombinedSpecializations") { - testValidTypes(CTFloat | CTInteger, CTFloat | CTInteger)(CTFloat | CTInteger) - } - - test("shouldFailTypeCheckWhenIncompatible") { - testInvalidApplication(CTInteger, CTBoolean)( - "Type mismatch: expected Float or Integer but was Boolean" - ) - testInvalidApplication(CTBoolean, CTInteger)( - "Type mismatch: expected Float, Integer or Duration but was Boolean" - ) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/FilterExpressionTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/FilterExpressionTest.scala deleted file mode 100644 index 2da86247911f1..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/FilterExpressionTest.scala +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{DummyExpression, FilterExpression, True} - -class FilterExpressionTest extends SemanticFunSuite { - - val dummyExpression = DummyExpression( - possibleTypes = CTList(CTNode) | CTBoolean | CTList(CTString) - ) - - test("shouldHaveCollectionTypesOfInnerExpression") { - val filter = FilterExpression( - variable = variable("x"), - expression = dummyExpression, - innerPredicate = Some(True()(DummyPosition(5))) - )(DummyPosition(0)) - val result = SemanticExpressionCheck.simple(filter)(SemanticState.clean) - result.errors shouldBe empty - types(filter)(result.state) should equal(CTList(CTNode) | CTList(CTString)) - } - - test("shouldRaiseSyntaxErrorIfMissingPredicate") { - val filter = FilterExpression( - variable = variable("x"), - expression = dummyExpression, - innerPredicate = None - )(DummyPosition(0)) - val result = SemanticExpressionCheck.simple(filter)(SemanticState.clean) - result.errors should equal(Seq(SemanticError("filter(...) requires a WHERE predicate", DummyPosition(0)))) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/FilteringExpressionTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/FilteringExpressionTest.scala deleted file mode 100644 index dfe389ad1af96..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/FilteringExpressionTest.scala +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.v3_5.expressions.{DummyExpression, ListComprehension} - -class FilteringExpressionTest extends SemanticFunSuite { - - test("shouldSemanticCheckPredicateInStateContainingTypedVariable") { - val expression = DummyExpression(CTList(CTNode) | CTBoolean | CTList(CTString), pos) - - val error = SemanticError("dummy error", pos) - val predicate = CustomExpression( - (ctx, self) => s => { - s.symbolTypes("x") should equal(CTNode | CTString) - SemanticCheckResult.error(s, error) - } - ) - - val filter = ListComprehension(variable("x"), expression, Some(predicate), None)(pos) - val result = SemanticExpressionCheck.simple(filter)(SemanticState.clean) - result.errors should equal(Seq(error)) - result.state.symbol("x") should equal(None) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/GreaterThanOrEqualTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/GreaterThanOrEqualTest.scala deleted file mode 100644 index 923a1952bc9b8..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/GreaterThanOrEqualTest.scala +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.GreaterThanOrEqual - -class GreaterThanOrEqualTest extends InfixExpressionTestBase(GreaterThanOrEqual(_, _)(DummyPosition(0))) { - - test("shouldSupportComparingIntegers") { - testValidTypes(CTInteger, CTInteger)(CTBoolean) - } - - test("shouldSupportComparingDoubles") { - testValidTypes(CTFloat, CTFloat)(CTBoolean) - } - - test("shouldSupportComparingStrings") { - testValidTypes(CTString, CTString)(CTBoolean) - } - - test("shouldSupportComparingPoints") { - testValidTypes(CTPoint, CTPoint)(CTBoolean) - } - - test("shouldSupportComparingTemporals") { - testValidTypes(CTDate, CTDate)(CTBoolean) - testValidTypes(CTTime, CTTime)(CTBoolean) - testValidTypes(CTLocalTime, CTLocalTime)(CTBoolean) - testValidTypes(CTDateTime, CTDateTime)(CTBoolean) - testValidTypes(CTLocalDateTime, CTLocalDateTime)(CTBoolean) - } - - test("shouldReturnErrorIfInvalidArgumentTypes") { - testInvalidApplication(CTNode, CTInteger)("Type mismatch: expected Float, Integer, Point, String, Date, Time, LocalTime, LocalDateTime or DateTime but was Node") - testInvalidApplication(CTInteger, CTNode)("Type mismatch: expected Float or Integer but was Node") - testInvalidApplication(CTDuration, CTDuration)("Type mismatch: expected Float, Integer, Point, String, Date, Time, LocalTime, LocalDateTime or DateTime but was Duration") - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/GreaterThanTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/GreaterThanTest.scala deleted file mode 100644 index 2cf34acc6b0c9..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/GreaterThanTest.scala +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.GreaterThan - -class GreaterThanTest extends InfixExpressionTestBase(GreaterThan(_, _)(DummyPosition(0))) { - - test("shouldSupportComparingIntegers") { - testValidTypes(CTInteger, CTInteger)(CTBoolean) - } - - test("shouldSupportComparingDoubles") { - testValidTypes(CTFloat, CTFloat)(CTBoolean) - } - - test("shouldSupportComparingStrings") { - testValidTypes(CTString, CTString)(CTBoolean) - } - - test("shouldSupportComparingPoints") { - testValidTypes(CTPoint, CTPoint)(CTBoolean) - } - - test("shouldSupportComparingTemporals") { - testValidTypes(CTDate, CTDate)(CTBoolean) - testValidTypes(CTTime, CTTime)(CTBoolean) - testValidTypes(CTLocalTime, CTLocalTime)(CTBoolean) - testValidTypes(CTDateTime, CTDateTime)(CTBoolean) - testValidTypes(CTLocalDateTime, CTLocalDateTime)(CTBoolean) - } - - test("shouldReturnErrorIfInvalidArgumentTypes") { - testInvalidApplication(CTNode, CTInteger)("Type mismatch: expected Float, Integer, Point, String, Date, Time, LocalTime, LocalDateTime or DateTime but was Node") - testInvalidApplication(CTInteger, CTNode)("Type mismatch: expected Float or Integer but was Node") - testInvalidApplication(CTDuration, CTDuration)("Type mismatch: expected Float, Integer, Point, String, Date, Time, LocalTime, LocalDateTime or DateTime but was Duration") - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/HexIntegerLiteralTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/HexIntegerLiteralTest.scala deleted file mode 100644 index 2a6a855f60add..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/HexIntegerLiteralTest.scala +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.v3_5.expressions.Expression.SemanticContext -import org.neo4j.cypher.internal.v3_5.expressions.SignedHexIntegerLiteral - -class HexIntegerLiteralTest extends SemanticFunSuite { - test("correctly parses hexadecimal numbers") { - assert(SignedHexIntegerLiteral("0x22")(DummyPosition(0)).value === 0x22) - assert(SignedHexIntegerLiteral("0x0")(DummyPosition(0)).value === 0) - assert(SignedHexIntegerLiteral("0xffFF")(DummyPosition(0)).value === 0xffff) - assert(SignedHexIntegerLiteral("-0x9abc")(DummyPosition(0)).value === -0x9abc) - } - - test("throws error for invalid hexadecimal numbers") { - assertSemanticError("0x12g3", "invalid literal number") - assertSemanticError("0x", "invalid literal number") - assertSemanticError("0x33Y23", "invalid literal number") - assertSemanticError("-0x12g3", "invalid literal number") - } - - test("throws error for too large hexadecimal numbers") { - assertSemanticError("0xfffffffffffffffff", "integer is too large") - } - - private def assertSemanticError(stringValue: String, errorMessage: String) { - val literal = SignedHexIntegerLiteral(stringValue)(DummyPosition(4)) - val result = SemanticExpressionCheck.check(SemanticContext.Simple, literal)(SemanticState.clean) - assert(result.errors === Vector(SemanticError(errorMessage, DummyPosition(4)))) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/InfixExpressionTestBase.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/InfixExpressionTestBase.scala deleted file mode 100644 index 74460085f2840..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/InfixExpressionTestBase.scala +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{DummyExpression, Expression} - -abstract class InfixExpressionTestBase(ctr: (Expression, Expression) => Expression) extends SemanticFunSuite { - - protected def testValidTypes(lhsTypes: TypeSpec, rhsTypes: TypeSpec)(expected: TypeSpec) { - val (result, expression) = evaluateWithTypes(lhsTypes, rhsTypes) - result.errors shouldBe empty - types(expression)(result.state) should equal(expected) - } - - protected def testInvalidApplication(lhsTypes: TypeSpec, rhsTypes: TypeSpec)(message: String) { - val (result, _) = evaluateWithTypes(lhsTypes, rhsTypes) - result.errors should not be empty - result.errors.head.msg should equal(message) - } - - protected def evaluateWithTypes(lhsTypes: TypeSpec, rhsTypes: TypeSpec): (SemanticCheckResult, Expression) = { - val lhs = DummyExpression(lhsTypes) - val rhs = DummyExpression(rhsTypes) - - val expression = ctr(lhs, rhs) - - val state = SemanticExpressionCheck.simple(Seq(lhs, rhs))(SemanticState.clean).state - (SemanticExpressionCheck.simple(expression)(state), expression) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/LessThanOrEqualTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/LessThanOrEqualTest.scala deleted file mode 100644 index 75ede9dd02f12..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/LessThanOrEqualTest.scala +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.LessThanOrEqual - -class LessThanOrEqualTest extends InfixExpressionTestBase(LessThanOrEqual(_, _)(DummyPosition(0))) { - - test("shouldSupportComparingIntegers") { - testValidTypes(CTInteger, CTInteger)(CTBoolean) - } - - test("shouldSupportComparingDoubles") { - testValidTypes(CTFloat, CTFloat)(CTBoolean) - } - - test("shouldSupportComparingStrings") { - testValidTypes(CTString, CTString)(CTBoolean) - } - - test("shouldSupportComparingPoints") { - testValidTypes(CTPoint, CTPoint)(CTBoolean) - } - - test("shouldSupportComparingTemporals") { - testValidTypes(CTDate, CTDate)(CTBoolean) - testValidTypes(CTTime, CTTime)(CTBoolean) - testValidTypes(CTLocalTime, CTLocalTime)(CTBoolean) - testValidTypes(CTDateTime, CTDateTime)(CTBoolean) - testValidTypes(CTLocalDateTime, CTLocalDateTime)(CTBoolean) - } - - test("shouldReturnErrorIfInvalidArgumentTypes") { - testInvalidApplication(CTNode, CTInteger)("Type mismatch: expected Float, Integer, Point, String, Date, Time, LocalTime, LocalDateTime or DateTime but was Node") - testInvalidApplication(CTInteger, CTNode)("Type mismatch: expected Float or Integer but was Node") - testInvalidApplication(CTDuration, CTDuration)("Type mismatch: expected Float, Integer, Point, String, Date, Time, LocalTime, LocalDateTime or DateTime but was Duration") - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/LessThanTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/LessThanTest.scala deleted file mode 100644 index 221b04e863386..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/LessThanTest.scala +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.LessThan - -class LessThanTest extends InfixExpressionTestBase(LessThan(_, _)(DummyPosition(0))) { - - test("shouldSupportComparingIntegers") { - testValidTypes(CTInteger, CTInteger)(CTBoolean) - } - - test("shouldSupportComparingDoubles") { - testValidTypes(CTFloat, CTFloat)(CTBoolean) - } - - test("shouldSupportComparingStrings") { - testValidTypes(CTString, CTString)(CTBoolean) - } - - test("shouldSupportComparingPoints") { - testValidTypes(CTPoint, CTPoint)(CTBoolean) - } - - test("shouldSupportComparingTemporals") { - testValidTypes(CTDate, CTDate)(CTBoolean) - testValidTypes(CTTime, CTTime)(CTBoolean) - testValidTypes(CTLocalTime, CTLocalTime)(CTBoolean) - testValidTypes(CTDateTime, CTDateTime)(CTBoolean) - testValidTypes(CTLocalDateTime, CTLocalDateTime)(CTBoolean) - } - - test("shouldReturnErrorIfInvalidArgumentTypes") { - testInvalidApplication(CTNode, CTInteger)("Type mismatch: expected Float, Integer, Point, String, Date, Time, LocalTime, LocalDateTime or DateTime but was Node") - testInvalidApplication(CTInteger, CTNode)("Type mismatch: expected Float or Integer but was Node") - testInvalidApplication(CTDuration, CTDuration)("Type mismatch: expected Float, Integer, Point, String, Date, Time, LocalTime, LocalDateTime or DateTime but was Duration") - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ListComprehensionTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ListComprehensionTest.scala deleted file mode 100644 index 26199f29cf5a3..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ListComprehensionTest.scala +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.v3_5.expressions.{DummyExpression, ListComprehension, Variable} - -class ListComprehensionTest extends SemanticFunSuite { - - val dummyExpression = DummyExpression( - CTList(CTNode) | CTBoolean | CTList(CTString)) - - test("withoutExtractExpressionShouldHaveCollectionTypesOfInnerExpression") { - val filter = ListComprehension(Variable("x")(DummyPosition(5)), dummyExpression, None, None)(DummyPosition(0)) - val result = SemanticExpressionCheck.simple(filter)(SemanticState.clean) - result.errors shouldBe empty - types(filter)(result.state) should equal(CTList(CTNode) | CTList(CTString)) - } - - test("shouldHaveCollectionWithInnerTypesOfExtractExpression") { - val extractExpression = DummyExpression(CTNode | CTNumber, DummyPosition(2)) - - val filter = ListComprehension(Variable("x")(DummyPosition(5)), dummyExpression, None, Some(extractExpression))(DummyPosition(0)) - val result = SemanticExpressionCheck.simple(filter)(SemanticState.clean) - result.errors shouldBe empty - types(filter)(result.state) should equal(CTList(CTNode) | CTList(CTNumber)) - } - - test("shouldSemanticCheckPredicateInStateContainingTypedVariable") { - val error = SemanticError("dummy error", DummyPosition(8)) - val predicate = ErrorExpression(error, CTAny, DummyPosition(7)) - - val filter = ListComprehension(Variable("x")(DummyPosition(2)), dummyExpression, Some(predicate), None)(DummyPosition(0)) - val result = SemanticExpressionCheck.simple(filter)(SemanticState.clean) - result.errors should equal(Seq(error)) - result.state.symbol("x") should equal(None) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ListSliceTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ListSliceTest.scala deleted file mode 100644 index 7e87377337ad5..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ListSliceTest.scala +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.v3_5.expressions.{DecimalDoubleLiteral, DummyExpression, ListSlice, SignedDecimalIntegerLiteral} - -class ListSliceTest extends SemanticFunSuite { - val dummyList = DummyExpression( - CTList(CTNode) | CTNode | CTList(CTString)) - - test("shouldReturnCollectionTypesOfExpression") { - val slice = ListSlice(dummyList, - Some(SignedDecimalIntegerLiteral("1")(DummyPosition(5))), - Some(SignedDecimalIntegerLiteral("2")(DummyPosition(7))) - )(DummyPosition(4)) - - val result = SemanticExpressionCheck.simple(slice)(SemanticState.clean) - result.errors shouldBe empty - types(slice)(result.state) should equal(CTList(CTNode) | CTList(CTString)) - } - - test("shouldRaiseErrorWhenNeitherFromOrTwoSpecified") { - val slice = ListSlice(dummyList, None, None)(DummyPosition(4)) - - val result = SemanticExpressionCheck.simple(slice)(SemanticState.clean) - result.errors should equal(Seq(SemanticError("The start or end (or both) is required for a collection slice", slice.position))) - } - - test("shouldRaiseErrorIfStartingFromFraction") { - val to = DecimalDoubleLiteral("1.3")(DummyPosition(5)) - val slice = ListSlice(dummyList, None, Some(to))(DummyPosition(4)) - - val result = SemanticExpressionCheck.simple(slice)(SemanticState.clean) - result.errors should equal(Seq(SemanticError("Type mismatch: expected Integer but was Float", to.position))) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/LiteralTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/LiteralTest.scala deleted file mode 100644 index 58005e96d5af5..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/LiteralTest.scala +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{Literal, StringLiteral, UnsignedDecimalIntegerLiteral} - -class LiteralTest extends SemanticFunSuite { - test("has type CTString") { - val literal = StringLiteral("foo")(pos) - val result = SemanticExpressionCheck.simple(literal)(SemanticState.clean) - val expressionType = result.state.expressionType(literal).actual - - assert(expressionType === CTString.invariant) - } - - test("correctly parses unsigned decimal numbers") { - assert(UnsignedDecimalIntegerLiteral("22")(pos).value === 22) - assert(UnsignedDecimalIntegerLiteral("0")(pos).value === 0) - } - - test("throws error for invalid unsigned decimal numbers") { - assertSemanticError(unsignedDecimal("12g3"), "invalid literal number") - assertSemanticError(unsignedDecimal("923_23"), "invalid literal number") - } - - test("throws error for too large unsigned decimal numbers") { - assertSemanticError(unsignedDecimal("999999999999999999999999999"), "integer is too large") - } - - test("correctly parses signed decimal numbers") { - assert(signedDecimal("22").value === 22) - assert(signedDecimal("0").value === 0) - assert(signedDecimal("-0").value === 0) - assert(signedDecimal("-432").value === -432) - } - - test("throws error for invalid signed decimal numbers") { - assertSemanticError(signedDecimal("12g3"), "invalid literal number") - assertSemanticError(signedDecimal("923_23"), "invalid literal number") - assertSemanticError(signedDecimal("-92f3"), "invalid literal number") - } - - test("throws error for too large signed decimal numbers") { - assertSemanticError(signedDecimal("999999999999999999999999999"), "integer is too large") - } - - test("correctly parses decimal double numbers") { - assert(decimalDouble("22.34").value === 22.34) - assert(decimalDouble("-2342.34").value === -2342.34) - assert(decimalDouble("0.34").value === 0.34) - assert(decimalDouble("-.23").value === -.23) - assert(decimalDouble("0.0").value === 0.0) - assert(decimalDouble("-0.0").value === 0.0) - assert(decimalDouble("1E23").value === 1E23) - assert(decimalDouble("1e23").value === 1E23) - assert(decimalDouble("-134E233").value === -134E233) - assert(decimalDouble("-134e233").value === -134E233) - assert(decimalDouble("1E-99").value === 1E-99) - assert(decimalDouble("1e-99").value === 1E-99) - assert(decimalDouble("-4E-593").value === -4E-593) - assert(decimalDouble("-4e-593").value === -4E-593) - assert(decimalDouble("3.42E34").value === 3.42E34) - assert(decimalDouble("3.42e34").value === 3.42E34) - assert(decimalDouble("-65.342546547E33").value === -65.342546547E33) - assert(decimalDouble("-65.342546547e33").value === -65.342546547E33) - assert(decimalDouble("73.234E-235").value === 73.234E-235) - assert(decimalDouble("73.234e-235").value === 73.234E-235) - assert(decimalDouble("-73.234E-235").value === -73.234E-235) - assert(decimalDouble("-73.234e-235").value === -73.234E-235) - } - - test("throws error for invalid decimal double numbers") { - assertSemanticError(decimalDouble("33..34"), "invalid literal number") - assertSemanticError(decimalDouble("3f.34"), "invalid literal number") - assertSemanticError(decimalDouble("3._4"), "invalid literal number") - assertSemanticError(decimalDouble("2EE4"), "invalid literal number") - assertSemanticError(decimalDouble("2eE4"), "invalid literal number") - assertSemanticError(decimalDouble("2Ee4"), "invalid literal number") - assertSemanticError(decimalDouble("2ee4"), "invalid literal number") - assertSemanticError(decimalDouble("2E--4"), "invalid literal number") - assertSemanticError(decimalDouble("2e--4"), "invalid literal number") - assertSemanticError(decimalDouble("2E"), "invalid literal number") - assertSemanticError(decimalDouble("2e"), "invalid literal number") - assertSemanticError(decimalDouble("2..3E34"), "invalid literal number") - assertSemanticError(decimalDouble("2..3e34"), "invalid literal number") - } - - test("throws error for too large decimal numbers") { - assertSemanticError(decimalDouble("1E9999"), "floating point number is too large") - assertSemanticError(decimalDouble("1e9999"), "floating point number is too large") - } - - test("correctly parses octal numbers") { - assert(signedOctal("022").value === 0x12) - assert(signedOctal("00").value === 0x0) - assert(signedOctal("0734").value === 0x1dc) - assert(signedOctal("0034").value === 0x1c) - } - - test("throws error for invalid octal numbers") { - assertSemanticError(signedOctal("0393"), "invalid literal number") - assertSemanticError(signedOctal("03f4"), "invalid literal number") - assertSemanticError(signedOctal("-0934"), "invalid literal number") - } - - test("throws error for too large octal numbers") { - assertSemanticError(signedOctal("077777777777777777777777777777"), "integer is too large") - } - - private def assertSemanticError(literal: Literal, errorMessage: String) { - val result = SemanticExpressionCheck.simple(literal)(SemanticState.clean) - assert(result.errors === Vector(SemanticError(errorMessage, pos))) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ModuloTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ModuloTest.scala deleted file mode 100644 index f75dbd2cc4ae8..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ModuloTest.scala +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.Modulo - -class ModuloTest extends InfixExpressionTestBase(Modulo(_, _)(DummyPosition(0))) { - - // Infix specializations: - // 1 % 1 => 0 - // 1 % 1.1 => 1.0 - // 1.1 % 1 => 0.1 - // 1.1 % 1.1 => 0.0 - - test("should handle all specializations") { - testValidTypes(CTInteger, CTInteger)(CTInteger) - testValidTypes(CTInteger, CTFloat)(CTFloat) - testValidTypes(CTFloat, CTInteger)(CTFloat) - testValidTypes(CTFloat, CTFloat)(CTFloat) - } - - test("should handle combined specializations") { - testValidTypes(CTFloat | CTInteger, CTFloat | CTInteger)(CTFloat | CTInteger) - } - - test("should fail type check when adding incompatible") { - testInvalidApplication(CTInteger, CTBoolean)( - "Type mismatch: expected Float or Integer but was Boolean" - ) - testInvalidApplication(CTBoolean, CTInteger)( - "Type mismatch: expected Float or Integer but was Boolean" - ) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/MultiplyTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/MultiplyTest.scala deleted file mode 100644 index deb94934637dd..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/MultiplyTest.scala +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.Multiply - -class MultiplyTest extends InfixExpressionTestBase(Multiply(_, _)(DummyPosition(0))) { - - // Infix specializations: - // 1 * 1 => 1 - // 1 * 1.1 => 1.1 - // 1.1 * 1 => 1.1 - // 1.1 * 1.1 => 1.21 - - test("shouldHandleAllSpecializations") { - testValidTypes(CTInteger, CTInteger)(CTInteger) - testValidTypes(CTInteger, CTFloat)(CTFloat) - testValidTypes(CTFloat, CTInteger)(CTFloat) - testValidTypes(CTFloat, CTFloat)(CTFloat) - testValidTypes(CTDuration, CTFloat)(CTDuration) - testValidTypes(CTDuration, CTInteger)(CTDuration) - testValidTypes(CTFloat, CTDuration)(CTDuration) - testValidTypes(CTInteger, CTDuration)(CTDuration) - } - - test("shouldHandleCombinedSpecializations") { - testValidTypes(CTFloat | CTInteger, CTFloat | CTInteger)(CTFloat | CTInteger) - } - - test("shouldFailTypeCheckWhenAddingIncompatible") { - testInvalidApplication(CTInteger, CTBoolean)( - "Type mismatch: expected Float, Integer or Duration but was Boolean" - ) - testInvalidApplication(CTBoolean, CTInteger)( - "Type mismatch: expected Float, Integer or Duration but was Boolean" - ) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/OrTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/OrTest.scala deleted file mode 100644 index 9c33052b68794..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/OrTest.scala +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.Or - -class OrTest extends InfixExpressionTestBase(Or(_, _)(DummyPosition(0))) { - - test("shouldCombineBooleans") { - testValidTypes(CTBoolean, CTBoolean)(CTBoolean) - } - - test("shouldCoerceArguments") { - testInvalidApplication(CTInteger, CTBoolean)("Type mismatch: expected Boolean but was Integer") - testInvalidApplication(CTBoolean, CTInteger)("Type mismatch: expected Boolean but was Integer") - } - - test("shouldReturnErrorIfInvalidArgumentTypes") { - testInvalidApplication(CTNode, CTBoolean)("Type mismatch: expected Boolean but was Node") - testInvalidApplication(CTBoolean, CTNode)("Type mismatch: expected Boolean but was Node") - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/PatternComprehensionTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/PatternComprehensionTest.scala deleted file mode 100644 index 830f7a4469328..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/PatternComprehensionTest.scala +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions._ - -class PatternComprehensionTest extends SemanticFunSuite { - - val n = NodePattern(Some(variable("n")), Seq.empty, None)(pos) - val x = NodePattern(Some(variable("x")), Seq.empty, None)(pos) - val r = RelationshipPattern(None, Seq.empty, None, None, SemanticDirection.OUTGOING)(pos) - val pattern = RelationshipsPattern(RelationshipChain(n, r, x)(pos))(pos) - val property = Property(variable("x"), PropertyKeyName("prop")(pos))(pos) - val failingProperty = Property(variable("missing"), PropertyKeyName("prop")(pos))(pos) - val stringLiteral = StringLiteral("APA")(pos) - - test("pattern comprehension on a property returns the expected type") { - val expression = PatternComprehension(None, pattern, None, property)(pos) - - val result = SemanticExpressionCheck.simple(expression)(SemanticState.clean) - - result.errors shouldBe empty - types(expression)(result.state) should equal(CTList(CTAny).covariant) - } - - test("pattern comprehension with literal string projection has correct type") { - val expression = PatternComprehension(None, pattern, None, stringLiteral)(pos) - - val result = SemanticExpressionCheck.simple(expression)(SemanticState.clean) - - result.errors shouldBe empty - types(expression)(result.state) should equal(CTList(CTString).invariant) - } - - test("inner projection using missing identifier reports error") { - val expression = PatternComprehension(None, pattern, None, failingProperty)(pos) - - val result = SemanticExpressionCheck.simple(expression)(SemanticState.clean) - - result.errors shouldBe Seq(SemanticError("Variable `missing` not defined", pos)) - } - - test("inner filter using missing identifier reports error") { - val expression = PatternComprehension(None, pattern, Some(failingProperty), stringLiteral)(pos) - - val result = SemanticExpressionCheck.simple(expression)(SemanticState.clean) - - result.errors shouldBe Seq(SemanticError("Variable `missing` not defined", pos)) - } - - test("pattern can't reuse identifier with different type") { - val expression = PatternComprehension(None, pattern, None, stringLiteral)(pos) - - val semanticState = SemanticState.clean.declareVariable(variable("n"), CTBoolean).right.get - val result = SemanticExpressionCheck.simple(expression)(semanticState) - - result.errors shouldBe Seq( - SemanticError("Type mismatch: n already defined with conflicting type Boolean (expected Node)", pos, pos) - ) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/PowTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/PowTest.scala deleted file mode 100644 index 5292f67e992c0..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/PowTest.scala +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.Pow - -class PowTest extends InfixExpressionTestBase(Pow(_, _)(DummyPosition(0))) { - - // Infix specializations: - // 1 ^ 1 => 1 - // 1 ^ 1.1 => 1 - // 1.1 ^ 1 => 1.1 - // 1.1 ^ 1.1 => 1.1105 - - test("shouldHandleAllSpecializations") { - testValidTypes(CTInteger, CTInteger)(CTFloat) - testValidTypes(CTInteger, CTFloat)(CTFloat) - testValidTypes(CTFloat, CTInteger)(CTFloat) - testValidTypes(CTFloat, CTFloat)(CTFloat) - } - - test("shouldHandleCombinedSpecializations") { - testValidTypes(CTFloat | CTInteger, CTFloat | CTInteger)(CTFloat) - } - - test("shouldFailTypeCheckWhenAddingIncompatible") { - testInvalidApplication(CTInteger, CTBoolean)( - "Type mismatch: expected Float but was Boolean" - ) - testInvalidApplication(CTBoolean, CTInteger)( - "Type mismatch: expected Float but was Boolean" - ) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/PropertyTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/PropertyTest.scala deleted file mode 100644 index 27430ab7cf7ab..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/PropertyTest.scala +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{PropertyKeyName, Variable} - -class PropertyTest extends SemanticFunSuite { - - test("accepts property access on a map") { - val mapExpr: Variable = variable("map") - val propertyKey: PropertyKeyName = propertyKeyName("prop") - - val beforeState = SemanticState.clean.newChildScope.declareVariable(mapExpr, CTMap).right.get - - val result = SemanticExpressionCheck.simple(property(mapExpr, propertyKey))(beforeState) - - result.errors shouldBe empty - } - - test("accepts property access on a node") { - val mapExpr: Variable = variable("map") - val propertyKey: PropertyKeyName = propertyKeyName("prop") - - val beforeState = SemanticState.clean.newChildScope.declareVariable(mapExpr, CTNode).right.get - - val result = SemanticExpressionCheck.simple(property(mapExpr, propertyKey))(beforeState) - - result.errors shouldBe empty - } - - test("accepts property access on a relationship") { - val mapExpr: Variable = variable("map") - val propertyKey: PropertyKeyName = propertyKeyName("prop") - - val beforeState = SemanticState.clean.newChildScope.declareVariable(mapExpr, CTRelationship).right.get - - val result = SemanticExpressionCheck.simple(property(mapExpr, propertyKey))(beforeState) - - result.errors shouldBe empty - } - - test("accepts property access on an Any") { - val mapExpr: Variable = variable("map") - val propertyKey: PropertyKeyName = propertyKeyName("prop") - - val beforeState = SemanticState.clean.newChildScope.declareVariable(mapExpr, CTAny).right.get - - val result = SemanticExpressionCheck.simple(property(mapExpr, propertyKey))(beforeState) - - result.errors shouldBe empty - } - - test("accepts property access on a Point") { - val mapExpr: Variable = variable("map") - val propertyKey: PropertyKeyName = propertyKeyName("prop") - - val beforeState = SemanticState.clean.newChildScope.declareVariable(mapExpr, CTPoint).right.get - - val result = SemanticExpressionCheck.simple(property(mapExpr, propertyKey))(beforeState) - - result.errors shouldBe empty - } - - test("accepts property access on an Date") { - val mapExpr: Variable = variable("map") - val propertyKey: PropertyKeyName = propertyKeyName("prop") - - val beforeState = SemanticState.clean.newChildScope.declareVariable(mapExpr, CTDate).right.get - - val result = SemanticExpressionCheck.simple(property(mapExpr, propertyKey))(beforeState) - - result.errors shouldBe empty - } - - test("refuses property access on an Integer") { - val mapExpr: Variable = variable("map") - val propertyKey: PropertyKeyName = propertyKeyName("prop") - - val beforeState = SemanticState.clean.newChildScope.declareVariable(mapExpr, CTInteger).right.get - - val result = SemanticExpressionCheck.simple(property(mapExpr, propertyKey))(beforeState) - - result.errors should equal(Seq(SemanticError("Type mismatch: expected Any, Map, Node, Relationship, Point, Duration, Date, Time, LocalTime, LocalDateTime or DateTime but was Integer", pos))) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ReduceExpressionTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ReduceExpressionTest.scala deleted file mode 100644 index 421f0f76285b0..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ReduceExpressionTest.scala +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.v3_5.expressions.{DummyExpression, ReduceExpression, Variable} - -class ReduceExpressionTest extends SemanticFunSuite { - - test("shouldEvaluateReduceExpressionWithTypedVariables") { - val error = SemanticError("dummy error", DummyPosition(10)) - - val reduceExpression = CustomExpression( - (ctx, self) => - s => { - s.symbolTypes("x") should equal(CTString.invariant) - s.symbolTypes("y") should equal(CTInteger.invariant) - (specifyType(CTString, self) chain error)(s) - } - ) - - val filter = ReduceExpression( - accumulator = Variable("x")(DummyPosition(2)), - init = DummyExpression(CTString), - variable = Variable("y")(DummyPosition(6)), - list = DummyExpression(CTList(CTInteger)), - expression = reduceExpression - )(DummyPosition(0)) - - val result = SemanticExpressionCheck.simple(filter)(SemanticState.clean) - result.errors should equal(Seq(error)) - result.state.symbol("x") shouldBe empty - result.state.symbol("y") shouldBe empty - } - - test("shouldReturnMinimalTypeOfAccumulatorAndReduceFunction") { - val initType = CTString.covariant | CTFloat.covariant - val listType = CTList(CTInteger) - - val reduceExpression = CustomExpression( - (ctx, self) => - s => { - s.symbolTypes("x") should equal(CTString | CTFloat) - s.symbolTypes("y") should equal(listType.innerType.invariant) - (specifyType(CTFloat, self) chain SemanticCheckResult.success)(s) - } - ) - - val filter = ReduceExpression( - accumulator = Variable("x")(DummyPosition(2)), - init = DummyExpression(initType), - variable = Variable("y")(DummyPosition(6)), - list = DummyExpression(listType), - expression = reduceExpression - )(DummyPosition(0)) - - val result = SemanticExpressionCheck.simple(filter)(SemanticState.clean) - result.errors shouldBe empty - types(filter)(result.state) should equal(CTAny | CTFloat) - } - - test("shouldFailSemanticCheckIfReduceFunctionTypeDiffersFromAccumulator") { - val accumulatorType = CTString | CTNumber - val listType = CTList(CTInteger) - - val reduceExpression = CustomExpression( - (ctx, self) => - s => { - s.symbolTypes("x") should equal(accumulatorType) - s.symbolTypes("y") should equal(listType.innerType.invariant) - (specifyType(CTNode, self) chain SemanticCheckResult.success)(s) - } - ) - - val filter = ReduceExpression( - accumulator = Variable("x")(DummyPosition(2)), - init = DummyExpression(accumulatorType), - variable = Variable("y")(DummyPosition(6)), - list = DummyExpression(listType), - expression = reduceExpression - )(DummyPosition(0)) - - val result = SemanticExpressionCheck.simple(filter)(SemanticState.clean) - result.errors should have size 1 - result.errors.head.msg should equal("Type mismatch: accumulator is Number or String but expression has type Node") - result.errors.head.position should equal(reduceExpression.position) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticAnalysisToolingTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticAnalysisToolingTest.scala deleted file mode 100644 index bac63737e8ef5..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticAnalysisToolingTest.scala +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.DummyExpression - -class SemanticAnalysisToolingTest extends CypherFunSuite { - - val expression = DummyExpression(CTAny) - - val toTest = new SemanticAnalysisTooling {} - - test("shouldReturnCalculatedType") { - SemanticState.clean.expressionType(expression).actual should equal(TypeSpec.all) - } - - test("shouldReturnSpecifiedAndConstrainedTypes") { - val state = ( - toTest.specifyType(CTNode | CTInteger, expression) chain - toTest.expectType(CTNumber.covariant, expression) - )(SemanticState.clean).state - - state.expressionType(expression).actual should equal(CTInteger.invariant) - } - - test("shouldRaiseTypeErrorWhenMismatchBetweenSpecifiedTypeAndExpectedType") { - val result = ( - toTest.specifyType(CTNode | CTInteger, expression) chain - toTest.expectType(CTString.covariant, expression) - )(SemanticState.clean) - - result.errors should have size 1 - result.errors.head.position should equal(expression.position) - toTest.types(expression)(result.state) shouldBe empty - result.errors.head.msg should equal ("Type mismatch: expected String but was Integer or Node") - } - - test("shouldRaiseTypeErrorWithCustomMessageWhenMismatchBetweenSpecifiedTypeAndExpectedType") { - val result = ( - toTest.specifyType(CTNode | CTInteger, expression) chain - toTest.expectType(CTString.covariant, expression, - (expected: String, existing: String) => s"lhs was $expected yet rhs was $existing") - )(SemanticState.clean) - - result.errors should have size 1 - result.errors.head.position should equal(expression.position) - toTest.types(expression)(result.state) shouldBe empty - - assert(result.errors.size === 1) - assert(result.errors.head.position === expression.position) - assert(result.errors.head.msg == "Type mismatch: lhs was String yet rhs was Integer or Node") - assert(toTest.types(expression)(result.state).isEmpty) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticCaseExpressionTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticCaseExpressionTest.scala deleted file mode 100644 index f56c245e49c47..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticCaseExpressionTest.scala +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.v3_5.expressions.{CaseExpression, DummyExpression} - -class SemanticCaseExpressionTest extends SemanticFunSuite { - - test("Simple: Should combine types of alternatives") { - val caseExpression = CaseExpression( - expression = Some(literal("")), - alternatives = IndexedSeq( - ( - literal(""), - literal(1.0) - ), ( - literal(""), - literal(1) - ) - ), - default = Some(literal(1.0)) - )(DummyPosition(2)) - - val result = SemanticExpressionCheck.simple(caseExpression)(SemanticState.clean) - result.errors shouldBe empty - types(caseExpression)(result.state) should equal(CTInteger | CTFloat) - } - - test("Generic: Should combine types of alternatives") { - val caseExpression = CaseExpression( - None, - IndexedSeq( - ( - DummyExpression(CTBoolean), - DummyExpression(CTFloat | CTString) - ), ( - DummyExpression(CTBoolean), - DummyExpression(CTInteger) - ) - ), - Some(DummyExpression(CTFloat | CTNode)) - )(DummyPosition(2)) - - val result = SemanticExpressionCheck.simple(caseExpression)(SemanticState.clean) - result.errors shouldBe empty - types(caseExpression)(result.state) should equal(CTInteger | CTFloat | CTString | CTNode) - } - - test("Generic: should type check predicates") { - val caseExpression = CaseExpression( - None, - IndexedSeq( - ( - DummyExpression(CTBoolean), - DummyExpression(CTFloat) - ), ( - DummyExpression(CTString, DummyPosition(12)), - DummyExpression(CTInteger) - ) - ), - Some(DummyExpression(CTFloat)) - )(DummyPosition(2)) - - val result = SemanticExpressionCheck.simple(caseExpression)(SemanticState.clean) - result.errors should have size 1 - result.errors.head.msg should equal("Type mismatch: expected Boolean but was String") - result.errors.head.position should equal(DummyPosition(12)) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticExtractExpressionTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticExtractExpressionTest.scala deleted file mode 100644 index 09df13420b013..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticExtractExpressionTest.scala +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{DummyExpression, ExtractExpression, True, Variable} - -class SemanticExtractExpressionTest extends SemanticFunSuite { - - val dummyExpression = DummyExpression( - CTList(CTNode) | CTBoolean | CTList(CTString) - ) - - val extractExpression = DummyExpression(CTNode | CTNumber, DummyPosition(2)) - - test("shouldHaveCollectionWithInnerTypesOfExtractExpression") { - val extract = ExtractExpression(Variable("x")(DummyPosition(5)), dummyExpression, None, Some(extractExpression))(DummyPosition(0)) - val result = SemanticExpressionCheck.simple(extract)(SemanticState.clean) - result.errors shouldBe empty - types(extract)(result.state) should equal(CTList(CTNode) | CTList(CTNumber)) - } - - test("shouldRaiseSemanticErrorIfPredicateSpecified") { - val extract = ExtractExpression(Variable("x")(DummyPosition(5)), dummyExpression, Some(True()(DummyPosition(5))), Some(extractExpression))(DummyPosition(0)) - val result = SemanticExpressionCheck.simple(extract)(SemanticState.clean) - result.errors should equal(Seq(SemanticError("extract(...) should not contain a WHERE predicate", DummyPosition(0)))) - } - - test("shouldRaiseSemanticErrorIfMissingExtractExpression") { - val extract = ExtractExpression(Variable("x")(DummyPosition(5)), dummyExpression, None, None)(DummyPosition(0)) - val result = SemanticExpressionCheck.simple(extract)(SemanticState.clean) - result.errors should equal(Seq(SemanticError("extract(...) requires '| expression' (an extract expression)", DummyPosition(0)))) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticFunSuite.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticFunSuite.scala deleted file mode 100644 index ffb941d419599..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SemanticFunSuite.scala +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.ast.{CustomExpression, ErrorExpression} -import org.neo4j.cypher.internal.v3_5.expressions._ - -class SemanticFunSuite extends CypherFunSuite with SemanticAnalysisTooling { - - override def initTest(): Unit = { - SemanticExpressionCheck.semanticCheckFallback = - (ctx, e) => - e match { - case x:DummyExpression => - specifyType(x.possibleTypes, x) - - case x:ErrorExpression => - s => SemanticCheckResult.error(s, x.error) - - case x:CustomExpression => - x.semanticCheck(ctx, x) - - case x:Expression => - SemanticExpressionCheck.crashOnUnknownExpression(ctx, x) - } - } - - val pos = DummyPosition(0) - - def literal(x:String) = StringLiteral(x)(pos) - def literal(x:Double) = DecimalDoubleLiteral(x.toString)(pos) - def literal(x:Int) = SignedDecimalIntegerLiteral(x.toString)(pos) - - def unsignedDecimal(str:String) = UnsignedDecimalIntegerLiteral(str)(pos) - def signedDecimal(str:String) = SignedDecimalIntegerLiteral(str)(pos) - def decimalDouble(str:String) = DecimalDoubleLiteral(str)(pos) - def signedOctal(str:String) = SignedOctalIntegerLiteral(str)(pos) - - def variable(name: String): Variable = Variable(name)(pos) - def propertyKeyName(name: String) = PropertyKeyName("prop")(pos) - def property(variable:Variable, keyName:PropertyKeyName) = Property(variable, keyName)(pos) -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ShortestPathExpressionTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ShortestPathExpressionTest.scala deleted file mode 100644 index dff143a64fa3f..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/ShortestPathExpressionTest.scala +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.symbols.{TypeSpec, _} -import org.neo4j.cypher.internal.v3_5.expressions._ - -class ShortestPathExpressionTest extends SemanticFunSuite { - - test("should get correct types for shortestPath") { - // Given - val (exp, state) = makeShortestPathExpression(true) - - // When - val result = SemanticExpressionCheck.simple(exp)(state) - - // Then - result.errors shouldBe empty - types(exp)(result.state) should equal(TypeSpec.exact(CTPath)) - } - - test("should get correct types for allShortestPath") { - // Given - val (exp, state) = makeShortestPathExpression(false) - - // When - val result = SemanticExpressionCheck.simple(exp)(state) - - // Then - result.errors shouldBe empty - types(exp)(result.state) should equal(TypeSpec.exact(CTList(CTPath))) - } - - private def makeShortestPathExpression(single: Boolean): (ShortestPathExpression, SemanticState) = { - val state = Seq("n", "k").foldLeft(SemanticState.clean) { (acc, n) => - acc.specifyType(variable(n), TypeSpec.exact(CTNode)).right.get - } - val pattern = chain(node(Some(variable("n"))), relationship(None), node(Some(variable("k")))) - (ShortestPathExpression(ShortestPaths(pattern, single)(pos)), state) - } - private def chain(left: PatternElement, rel: RelationshipPattern, right: NodePattern): RelationshipChain = { - RelationshipChain(left, rel, right)(pos) - } - - private def relationship(id: Option[Variable]): RelationshipPattern = { - RelationshipPattern(id, Seq.empty, None, None, SemanticDirection.OUTGOING)(pos) - } - - private def node(id: Option[Variable]): NodePattern = { - NodePattern(id, Seq.empty, None)(pos) - } - -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SubtractTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SubtractTest.scala deleted file mode 100644 index 258d1b90ac1e7..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/SubtractTest.scala +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.Subtract - -class SubtractTest extends InfixExpressionTestBase(Subtract(_, _)(DummyPosition(0))) { - - // Infix specializations: - // 1 - 1 => 0 - // 1 - 1.1 => -0.1 - // 1.1 - 1 => 0.1 - // 1.1 - 1.1 => 0.0 - - test("shouldHandleAllSpecializations") { - testValidTypes(CTInteger, CTInteger)(CTInteger) - testValidTypes(CTInteger, CTFloat)(CTFloat) - testValidTypes(CTFloat, CTInteger)(CTFloat) - testValidTypes(CTFloat, CTFloat)(CTFloat) - testValidTypes(CTDuration, CTDuration)(CTDuration) - testValidTypes(CTDate, CTDuration)(CTDate) - testValidTypes(CTTime, CTDuration)(CTTime) - testValidTypes(CTLocalTime, CTDuration)(CTLocalTime) - testValidTypes(CTDateTime, CTDuration)(CTDateTime) - testValidTypes(CTLocalDateTime, CTDuration)(CTLocalDateTime) - } - - test("shouldHandleCombinedSpecializations") { - testValidTypes(CTFloat | CTInteger, CTFloat | CTInteger)(CTFloat | CTInteger) - } - - test("shouldFailTypeCheckForIncompatibleArguments") { - testInvalidApplication(CTInteger, CTBoolean)( - "Type mismatch: expected Float or Integer but was Boolean" - ) - testInvalidApplication(CTBoolean, CTInteger)( - "Type mismatch: expected Float, Integer, Duration, Date, Time, LocalTime, LocalDateTime or DateTime but was Boolean" - ) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/VariableTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/VariableTest.scala deleted file mode 100644 index 8f6780c59465a..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/VariableTest.scala +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.Variable - -class VariableTest extends SemanticFunSuite { - - test("shouldDefineVariableDuringSemanticCheckWhenUndefined") { - val position = DummyPosition(0) - val variable = Variable("x")(position) - - val result = SemanticExpressionCheck.simple(variable)(SemanticState.clean) - result.errors should have size 1 - result.errors.head.position should equal(position) - result.state.symbol("x").isDefined should equal(true) - result.state.symbolTypes("x") should equal(CTAny.covariant) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/XorTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/XorTest.scala deleted file mode 100644 index d04796b6c185c..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/XorTest.scala +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.Xor - -class XorTest extends InfixExpressionTestBase(Xor(_, _)(DummyPosition(0))) { - - test("shouldCombineBooleans") { - testValidTypes(CTBoolean, CTBoolean)(CTBoolean) - } - - test("shouldCoerceArguments") { - testInvalidApplication(CTInteger, CTBoolean)("Type mismatch: expected Boolean but was Integer") - testInvalidApplication(CTBoolean, CTInteger)("Type mismatch: expected Boolean but was Integer") - } - - test("shouldReturnErrorIfInvalidArgumentTypes") { - testInvalidApplication(CTNode, CTBoolean)("Type mismatch: expected Boolean but was Node") - testInvalidApplication(CTBoolean, CTNode)("Type mismatch: expected Boolean but was Node") - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/AbsTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/AbsTest.scala deleted file mode 100644 index 4665ed50b0859..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/AbsTest.scala +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -class AbsTest extends FunctionTestBase("abs") { - - test("shouldFailIfWrongArguments") { - testInvalidApplication()("Insufficient parameters for function 'abs'") - testInvalidApplication(CTFloat, CTFloat)("Too many parameters for function 'abs'") - } - - test("shouldHandleAllSpecializations") { - testValidTypes(CTInteger)(CTInteger) - testValidTypes(CTFloat)(CTFloat) - } - - test("shouldHandleCombinedSpecializations") { - testValidTypes(CTFloat | CTInteger)(CTFloat | CTInteger) - } - - test("shouldReturnErrorIfInvalidArgumentTypes") { - testInvalidApplication(CTNode)("Type mismatch: expected Float or Integer but was Node") - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/DistanceTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/DistanceTest.scala deleted file mode 100644 index e20b4d2aa783c..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/DistanceTest.scala +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -class DistanceTest extends FunctionTestBase("distance") { - - test("should accept correct types") { - testValidTypes(CTGeometry, CTGeometry)(CTFloat) - testValidTypes(CTPoint, CTGeometry)(CTFloat) - testValidTypes(CTGeometry, CTPoint)(CTFloat) - testValidTypes(CTPoint, CTPoint)(CTFloat) - // Distance produces null for invalid arguments, but never throws exceptions - testValidTypes(CTPoint, CTInteger)(CTFloat) - testValidTypes(CTInteger, CTPoint)(CTFloat) - testValidTypes(CTInteger, CTInteger)(CTFloat) - } - - test("should fail if wrong number of arguments") { - testInvalidApplication()( - "Insufficient parameters for function 'distance'" - ) - testInvalidApplication(CTMap)( - "Insufficient parameters for function 'distance'" - ) - testInvalidApplication(CTGeometry, CTGeometry, CTGeometry)( - "Too many parameters for function 'distance'" - ) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/FunctionTestBase.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/FunctionTestBase.scala deleted file mode 100644 index 2b92c36edad43..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/FunctionTestBase.scala +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics.functions - -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticCheckResult, SemanticExpressionCheck, SemanticFunSuite, SemanticState} -import org.neo4j.cypher.internal.v3_5.expressions.Expression.SemanticContext -import org.neo4j.cypher.internal.v3_5.expressions.{DummyExpression, FunctionInvocation, FunctionName} - -abstract class FunctionTestBase(funcName: String) extends SemanticFunSuite { - - protected val context: SemanticContext = SemanticContext.Simple - - protected def testValidTypes(argumentTypes: TypeSpec*)(expected: TypeSpec) { - val (result, invocation) = evaluateWithTypes(argumentTypes.toIndexedSeq) - result.errors shouldBe empty - types(invocation)(result.state) should equal(expected) - } - - protected def testInvalidApplication(argumentTypes: TypeSpec*)(message: String) { - val (result, _) = evaluateWithTypes(argumentTypes.toIndexedSeq) - result.errors should not be empty - result.errors.head.msg should equal(message) - } - - protected def evaluateWithTypes(argumentTypes: IndexedSeq[TypeSpec]): (SemanticCheckResult, FunctionInvocation) = { - val arguments = argumentTypes.map(DummyExpression(_)) - - val invocation = FunctionInvocation( - FunctionName(funcName)(DummyPosition(6)), - distinct = false, - arguments - )(DummyPosition(5)) - - val state = SemanticExpressionCheck.check(context, arguments)(SemanticState.clean).state - (SemanticExpressionCheck.check(context, invocation)(state), invocation) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/LabelsTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/LabelsTest.scala deleted file mode 100644 index 800908ebdde15..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/LabelsTest.scala +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -class LabelsTest extends FunctionTestBase("labels") { - - test("shouldFailIfWrongArguments") { - testInvalidApplication()("Insufficient parameters for function 'labels'") - testInvalidApplication(CTNode, CTNode)("Too many parameters for function 'labels'") - } - - test("shouldHaveCollectionOfStringsType") { - testValidTypes(CTNode)(CTList(CTString)) - } - - test("shouldReturnErrorIfInvalidArgumentTypes") { - testInvalidApplication(CTInteger)("Type mismatch: expected Node but was Integer") - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/PercentileContTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/PercentileContTest.scala deleted file mode 100644 index 20316d5334d8c..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/PercentileContTest.scala +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics.functions - -import org.neo4j.cypher.internal.v3_5.expressions.Expression.SemanticContext -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -class PercentileContTest extends FunctionTestBase("percentileCont") { - - override val context = SemanticContext.Results - - test("shouldHandleAllSpecializations") { - testValidTypes(CTInteger, CTInteger)(CTFloat) - testValidTypes(CTInteger, CTFloat)(CTFloat) - testValidTypes(CTFloat, CTInteger)(CTFloat) - testValidTypes(CTFloat, CTFloat)(CTFloat) - } - - test("shouldHandleCombinedSpecializations") { - testValidTypes(CTFloat | CTInteger, CTFloat | CTInteger)(CTFloat) - } - - test("shouldFailIfWrongArguments") { - testInvalidApplication(CTFloat)("Insufficient parameters for function 'percentileCont'") - testInvalidApplication(CTFloat, CTFloat, CTFloat)("Too many parameters for function 'percentileCont'") - } - - test("shouldFailTypeCheckWhenAddingIncompatible") { - testInvalidApplication(CTInteger, CTBoolean)( - "Type mismatch: expected Float but was Boolean" - ) - testInvalidApplication(CTBoolean, CTInteger)( - "Type mismatch: expected Float but was Boolean" - ) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/PercentileDiscTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/PercentileDiscTest.scala deleted file mode 100644 index 8a4c9d076e835..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/PercentileDiscTest.scala +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics.functions - -import org.neo4j.cypher.internal.v3_5.expressions.Expression.SemanticContext -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -class PercentileDiscTest extends FunctionTestBase("percentileDisc") { - - override val context = SemanticContext.Results - - test("shouldHandleAllSpecializations") { - testValidTypes(CTInteger, CTInteger)(CTInteger) - testValidTypes(CTInteger, CTFloat)(CTInteger) - testValidTypes(CTFloat, CTInteger)(CTFloat) - testValidTypes(CTFloat, CTFloat)(CTFloat) - } - - test("shouldHandleCombinedSpecializations") { - testValidTypes(CTFloat | CTInteger, CTFloat | CTInteger)(CTInteger | CTFloat) - } - - test("shouldFailIfWrongArguments") { - testInvalidApplication(CTFloat)("Insufficient parameters for function 'percentileDisc'") - testInvalidApplication(CTFloat, CTFloat, CTFloat)("Too many parameters for function 'percentileDisc'") - } - - test("shouldFailTypeCheckWhenAddingIncompatible") { - testInvalidApplication(CTInteger, CTBoolean)( - "Type mismatch: expected Float but was Boolean" - ) - testInvalidApplication(CTBoolean, CTInteger)( - "Type mismatch: expected Float or Integer but was Boolean" - ) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/PointTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/PointTest.scala deleted file mode 100644 index cc97247ad3150..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/PointTest.scala +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -class PointTest extends FunctionTestBase("point") { - - test("should accept correct types") { - testValidTypes(CTMap)(CTPoint) - } - - test("should fail type check for incompatible arguments") { - // TODO: Fix error message which seems to assume that Node and Relationships are acceptable maps - testInvalidApplication(CTList(CTAny))( - "Type mismatch: expected Map, Node or Relationship but was List" - ) - testInvalidApplication(CTString)( - "Type mismatch: expected Map, Node or Relationship but was String" - ) - } - - test("should fail if wrong number of arguments") { - testInvalidApplication()( - "Insufficient parameters for function 'point'" - ) - testInvalidApplication(CTMap, CTMap)( - "Too many parameters for function 'point'" - ) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/ReverseTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/ReverseTest.scala deleted file mode 100644 index b54de06acdfe7..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/ReverseTest.scala +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -class ReverseTest extends FunctionTestBase("reverse") { - - test("should reverse strings") { - testValidTypes(CTString)(CTString) - } - - test("should reverse lists") { - testValidTypes(CTList(CTNode))(CTList(CTNode)) - } - - test("should not reverse numbers") { - testInvalidApplication(CTInteger)( - "Type mismatch: expected String or List but was Integer" - ) - } - -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/SplitTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/SplitTest.scala deleted file mode 100644 index 33a1b10f5133d..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/SplitTest.scala +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -import scala.languageFeature.existentials - -class SplitTest extends FunctionTestBase("split") { - - test("shouldAcceptCorrectTypes") { - testValidTypes(CTString,CTString)(CTList(CTString)) - } - - test("shouldFailTypeCheckForIncompatibleArguments") { - testInvalidApplication(CTString, CTBoolean)( - "Type mismatch: expected String but was Boolean" - ) - - testInvalidApplication(CTInteger, CTString)( - "Type mismatch: expected String but was Integer" - ) - } - - test("shouldFailIfWrongNumberOfArguments") { - testInvalidApplication()( - "Insufficient parameters for function 'split'" - ) - testInvalidApplication(CTString)( - "Insufficient parameters for function 'split'" - ) - testInvalidApplication(CTString,CTString,CTString)( - "Too many parameters for function 'split'" - ) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/ToFloatTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/ToFloatTest.scala deleted file mode 100644 index 4270c8959496e..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/ToFloatTest.scala +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -class ToFloatTest extends FunctionTestBase("toFloat") { - - test("shouldAcceptCorrectTypes") { - testValidTypes(CTString)(CTFloat) - testValidTypes(CTFloat)(CTFloat) - testValidTypes(CTInteger)(CTFloat) - testValidTypes(CTNumber.covariant)(CTFloat) - testValidTypes(CTAny.covariant)(CTFloat) - } - - test("shouldFailTypeCheckForIncompatibleArguments") { - testInvalidApplication(CTList(CTAny).covariant)( - "Type mismatch: expected Float, Integer, Number or String but was List" - ) - - testInvalidApplication(CTNode)( - "Type mismatch: expected Float, Integer, Number or String but was Node" - ) - - testInvalidApplication(CTBoolean)( - "Type mismatch: expected Float, Integer, Number or String but was Boolean" - ) - } - - test("shouldFailIfWrongNumberOfArguments") { - testInvalidApplication()( - "Insufficient parameters for function 'toFloat'" - ) - testInvalidApplication(CTString, CTString)( - "Too many parameters for function 'toFloat'" - ) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/ToIntegerTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/ToIntegerTest.scala deleted file mode 100644 index ade451a3ea915..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/ToIntegerTest.scala +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -class ToIntegerTest extends FunctionTestBase("toInteger") { - - test("shouldAcceptCorrectTypes") { - testValidTypes(CTString)(CTInteger) - testValidTypes(CTFloat)(CTInteger) - testValidTypes(CTInteger)(CTInteger) - testValidTypes(CTNumber.covariant)(CTInteger) - testValidTypes(CTAny.covariant)(CTInteger) - } - - test("shouldFailTypeCheckForIncompatibleArguments") { - testInvalidApplication(CTList(CTAny).covariant)( - "Type mismatch: expected Float, Integer, Number or String but was List" - ) - - testInvalidApplication(CTNode)( - "Type mismatch: expected Float, Integer, Number or String but was Node" - ) - - testInvalidApplication(CTBoolean)( - "Type mismatch: expected Float, Integer, Number or String but was Boolean" - ) - } - - test("shouldFailIfWrongNumberOfArguments") { - testInvalidApplication()( - "Insufficient parameters for function 'toInteger'" - ) - testInvalidApplication(CTString, CTString)( - "Too many parameters for function 'toInteger'" - ) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/ToStringTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/ToStringTest.scala deleted file mode 100644 index 378ac39781e9a..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/semantics/functions/ToStringTest.scala +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.semantics.functions - -import org.neo4j.cypher.internal.util.v3_5.symbols._ - -class ToStringTest extends FunctionTestBase("toString") { - - test("should accept correct types or types that could be correct at runtime") { - testValidTypes(CTString)(CTString) - testValidTypes(CTFloat)(CTString) - testValidTypes(CTInteger)(CTString) - testValidTypes(CTBoolean)(CTString) - testValidTypes(CTAny.covariant)(CTString) - testValidTypes(CTNumber.covariant)(CTString) - testValidTypes(CTDuration)(CTString) - testValidTypes(CTDate)(CTString) - testValidTypes(CTTime)(CTString) - testValidTypes(CTLocalTime)(CTString) - testValidTypes(CTLocalDateTime)(CTString) - testValidTypes(CTDateTime)(CTString) - testValidTypes(CTPoint)(CTString) - } - - test("should fail type check for incompatible arguments") { - testInvalidApplication(CTRelationship)( - "Type mismatch: expected Boolean, Float, Integer, Point, String, Duration, Date, Time, LocalTime, LocalDateTime or DateTime but was Relationship" - ) - - testInvalidApplication(CTNode)( - "Type mismatch: expected Boolean, Float, Integer, Point, String, Duration, Date, Time, LocalTime, LocalDateTime or DateTime but was Node" - ) - } - - test("should fail if wrong number of arguments") { - testInvalidApplication()( - "Insufficient parameters for function 'toString'" - ) - testInvalidApplication(CTString, CTString)( - "Too many parameters for function 'toString'" - ) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/symbols/CypherTypeTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/symbols/CypherTypeTest.scala deleted file mode 100644 index 8f9ed7e93ea70..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/symbols/CypherTypeTest.scala +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.symbols - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite - -class CypherTypeTest extends CypherFunSuite { - test("parents should be full path up type tree branch") { - CTInteger.parents should equal(Seq(CTNumber, CTAny)) - CTNumber.parents should equal(Seq(CTAny)) - CTAny.parents should equal(Seq()) - CTList(CTString).parents should equal(Seq(CTList(CTAny), CTAny)) - } - - test("foo") { - val covariant = CTGraphRef.covariant - val s = covariant.toString - covariant should not be empty - } - - test("should be assignable from sub-type") { - CTNumber.isAssignableFrom(CTInteger) should equal(true) - CTAny.isAssignableFrom(CTString) should equal(true) - CTList(CTString).isAssignableFrom(CTList(CTString)) should equal(true) - CTList(CTNumber).isAssignableFrom(CTList(CTInteger)) should equal(true) - CTInteger.isAssignableFrom(CTNumber) should equal(false) - CTList(CTInteger).isAssignableFrom(CTList(CTString)) should equal(false) - } - - test("should find leastUpperBound") { - assertLeastUpperBound(CTNumber, CTNumber, CTNumber) - assertLeastUpperBound(CTNumber, CTAny, CTAny) - assertLeastUpperBound(CTNumber, CTString, CTAny) - assertLeastUpperBound(CTNumber, CTList(CTAny), CTAny) - assertLeastUpperBound(CTInteger, CTFloat, CTNumber) - assertLeastUpperBound(CTMap, CTFloat, CTAny) - } - - private def assertLeastUpperBound(a: CypherType, b: CypherType, result: CypherType) { - val simpleMergedType: CypherType = a leastUpperBound b - simpleMergedType should equal(result) - val listMergedType: CypherType = CTList(a) leastUpperBound CTList(b) - listMergedType should equal(CTList(result)) - } - - test("should find greatestLowerBound") { - assertGreatestLowerBound(CTNumber, CTNumber, Some(CTNumber)) - assertGreatestLowerBound(CTNumber, CTAny, Some(CTNumber)) - assertGreatestLowerBound(CTList(CTNumber), CTList(CTInteger), Some(CTList(CTInteger))) - assertGreatestLowerBound(CTNumber, CTString, None) - assertGreatestLowerBound(CTNumber, CTList(CTAny), None) - assertGreatestLowerBound(CTInteger, CTFloat, None) - assertGreatestLowerBound(CTMap, CTFloat, None) - assertGreatestLowerBound(CTBoolean, CTList(CTAny), None) - } - - private def assertGreatestLowerBound(a: CypherType, b: CypherType, result: Option[CypherType]) { - val simpleMergedType: Option[CypherType] = a greatestLowerBound b - simpleMergedType should equal(result) - val listMergedType: Option[CypherType] = CTList(a) greatestLowerBound CTList(b) - listMergedType should equal(for (t <- result) yield CTList(t)) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/symbols/TypeRangeTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/symbols/TypeRangeTest.scala deleted file mode 100644 index 8af007d54e9c5..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/symbols/TypeRangeTest.scala +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.symbols - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite - -class TypeRangeTest extends CypherFunSuite { - - test("TypeRange of single type should contain only that type") { - val rangeOfInteger = TypeRange(CTInteger, CTInteger) - rangeOfInteger.contains(CTInteger) should equal(true) - rangeOfInteger.contains(CTNumber) should equal(false) - rangeOfInteger.contains(CTFloat) should equal(false) - rangeOfInteger.contains(CTString) should equal(false) - rangeOfInteger.contains(CTAny) should equal(false) - - val rangeOfNumber = TypeRange(CTNumber, CTNumber) - rangeOfNumber.contains(CTInteger) should equal(false) - rangeOfNumber.contains(CTNumber) should equal(true) - rangeOfNumber.contains(CTFloat) should equal(false) - rangeOfNumber.contains(CTString) should equal(false) - rangeOfNumber.contains(CTAny) should equal(false) - - val rangeOfListAny = TypeRange(CTList(CTAny), CTList(CTAny)) - rangeOfListAny.contains(CTInteger) should equal(false) - rangeOfListAny.contains(CTNumber) should equal(false) - rangeOfListAny.contains(CTString) should equal(false) - rangeOfListAny.contains(CTList(CTString)) should equal(false) - rangeOfListAny.contains(CTList(CTNumber)) should equal(false) - rangeOfListAny.contains(CTList(CTAny)) should equal(true) - rangeOfListAny.contains(CTAny) should equal(false) - } - - test("unbounded TypeRange rooted at CTAny should contain all") { - val rangeRootedAtAny = TypeRange(CTAny, None) - rangeRootedAtAny.contains(CTAny) should equal(true) - rangeRootedAtAny.contains(CTString) should equal(true) - rangeRootedAtAny.contains(CTNumber) should equal(true) - rangeRootedAtAny.contains(CTInteger) should equal(true) - rangeRootedAtAny.contains(CTFloat) should equal(true) - rangeRootedAtAny.contains(CTNode) should equal(true) - rangeRootedAtAny.contains(CTList(CTAny)) should equal(true) - rangeRootedAtAny.contains(CTList(CTFloat)) should equal(true) - rangeRootedAtAny.contains(CTList(CTList(CTFloat))) should equal(true) - } - - test("unbounded TypeRange rooted at leaf type should contain leaf") { - val rangeRootedAtInteger = TypeRange(CTInteger, None) - rangeRootedAtInteger.contains(CTInteger) should equal(true) - rangeRootedAtInteger.contains(CTNumber) should equal(false) - rangeRootedAtInteger.contains(CTFloat) should equal(false) - rangeRootedAtInteger.contains(CTAny) should equal(false) - - val rangeRootedAtListOfNumber = TypeRange(CTList(CTNumber), None) - rangeRootedAtListOfNumber.contains(CTList(CTInteger)) should equal(true) - rangeRootedAtListOfNumber.contains(CTList(CTFloat)) should equal(true) - rangeRootedAtListOfNumber.contains(CTList(CTNumber)) should equal(true) - rangeRootedAtListOfNumber.contains(CTList(CTString)) should equal(false) - rangeRootedAtListOfNumber.contains(CTAny) should equal(false) - } - - test("unbounded TypeRange rooted at branch type should contain all more specific types") { - val rangeRootedAtInteger = TypeRange(CTNumber, None) - rangeRootedAtInteger.contains(CTInteger) should equal(true) - rangeRootedAtInteger.contains(CTFloat) should equal(true) - rangeRootedAtInteger.contains(CTNumber) should equal(true) - rangeRootedAtInteger.contains(CTString) should equal(false) - rangeRootedAtInteger.contains(CTAny) should equal(false) - - val rangeRootedAtListAny = TypeRange(CTList(CTAny), None) - rangeRootedAtListAny.contains(CTList(CTString)) should equal(true) - rangeRootedAtListAny.contains(CTList(CTInteger)) should equal(true) - rangeRootedAtListAny.contains(CTList(CTAny)) should equal(true) - rangeRootedAtListAny.contains(CTList(CTList(CTInteger))) should equal(true) - rangeRootedAtListAny.contains(CTBoolean) should equal(false) - rangeRootedAtListAny.contains(CTAny) should equal(false) - } - - test("should contain overlapping range") { - val rangeRootedAtNumber = TypeRange(CTNumber, None) - val rangeRootedAtInteger = TypeRange(CTInteger, None) - rangeRootedAtNumber.contains(rangeRootedAtInteger) should equal(true) - - val rangeOfNumberToDouble = TypeRange(CTNumber, CTFloat) - rangeOfNumberToDouble.contains(rangeRootedAtInteger) should equal(false) - rangeOfNumberToDouble.contains(rangeRootedAtNumber) should equal(false) - - val rangeOfDouble = TypeRange(CTFloat, CTFloat) - val rangeOfNumber = TypeRange(CTNumber, CTNumber) - val rangeOfInteger = TypeRange(CTInteger, CTInteger) - rangeOfNumberToDouble.contains(rangeOfDouble) should equal(true) - rangeOfNumberToDouble.contains(rangeOfNumber) should equal(true) - rangeOfNumberToDouble.contains(rangeOfInteger) should equal(false) - - val rangeRootedAtDouble = TypeRange(CTFloat, None) - rangeOfNumberToDouble.contains(rangeRootedAtDouble) should equal(false) - rangeRootedAtDouble.contains(rangeOfDouble) should equal(true) - - rangeRootedAtInteger.contains(rangeRootedAtDouble) should equal(false) - } - - test("intersection of range with overlapping range should not change range") { - val rangeRootedAtInteger = TypeRange(CTInteger, None) - rangeRootedAtInteger & TypeRange(CTNumber, None) should equal(Some(rangeRootedAtInteger)) - - val rangeOfInteger = TypeRange(CTInteger, CTInteger) - rangeOfInteger & TypeRange(CTNumber, None) should equal(Some(rangeOfInteger)) - - val rangeOfNumber = TypeRange(CTNumber, CTNumber) - rangeOfNumber & TypeRange(CTNumber, None) should equal(Some(rangeOfNumber)) - } - - test("intersection of range with intersecting range should return intersection") { - val rangeOfNumber = TypeRange(CTNumber, None) - rangeOfNumber & TypeRange(CTAny, CTNumber) should equal(Some(TypeRange(CTNumber, CTNumber))) - - val rangeToNumber = TypeRange(CTAny, CTNumber) - rangeToNumber & TypeRange(CTNumber, None) should equal(Some(TypeRange(CTNumber, CTNumber))) - } - - test("intersection of range to sub range should return sub range") { - val rangeOfAll = TypeRange(CTAny, None) - rangeOfAll & TypeRange(CTAny, CTNumber) should equal(Some(TypeRange(CTAny, CTNumber))) - rangeOfAll & TypeRange(CTNumber, CTNumber) should equal(Some(TypeRange(CTNumber, CTNumber))) - rangeOfAll & TypeRange(CTNumber, CTInteger) should equal(Some(TypeRange(CTNumber, CTInteger))) - - val rangeOfNumberToInteger = TypeRange(CTNumber, CTInteger) - rangeOfNumberToInteger & TypeRange(CTNumber, CTNumber) should equal(Some(TypeRange(CTNumber, CTNumber))) - rangeOfNumberToInteger & TypeRange(CTInteger, CTInteger) should equal(Some(TypeRange(CTInteger, CTInteger))) - } - - test("intersection of range within list") { - val rangeFromListAny = TypeRange(CTList(CTAny), None) - rangeFromListAny & TypeRange(CTList(CTString), None) should equal(Some(TypeRange(CTList(CTString), None))) - rangeFromListAny & TypeRange(CTList(CTString), CTList(CTString)) should equal(Some(TypeRange(CTList(CTString), CTList(CTString)))) - } - - test("intersection of range with non overlapping range should return none") { - val rangeFromNumber = TypeRange(CTNumber, None) - rangeFromNumber & TypeRange(CTString, None) should equal(None) - - val rangeOfNumber = TypeRange(CTNumber, CTNumber) - rangeOfNumber & TypeRange(CTString, None) should equal(None) - rangeOfNumber & TypeRange(CTBoolean, CTBoolean) should equal(None) - - val rangeOfAny = TypeRange(CTAny, CTAny) - rangeOfAny & rangeFromNumber should equal(None) - rangeOfAny & rangeOfNumber should equal(None) - rangeFromNumber & rangeOfAny should equal(None) - rangeOfNumber & rangeOfAny should equal(None) - } - - test("leastUpperBound with super type") { - val rangeFromAny = TypeRange(CTAny, None) - val rangeOfAny = TypeRange(CTAny, CTAny) - (rangeFromAny leastUpperBounds rangeOfAny) should equal(Seq(rangeOfAny)) - - val rangeOfInteger = TypeRange(CTInteger, None) - (rangeOfInteger leastUpperBounds rangeOfAny) should equal(Seq(rangeOfAny)) - - val rangeOfNumber = TypeRange(CTNumber, CTNumber) - (rangeOfInteger leastUpperBounds rangeOfNumber) should equal(Seq(rangeOfNumber)) - } - - test("leastUpperBound with sub type") { - val rangeFromListAny = TypeRange(CTList(CTAny), None) - val rangeOfListAny = TypeRange(CTList(CTAny), CTList(CTAny)) - (rangeFromListAny leastUpperBounds rangeOfListAny) should equal(Seq(rangeOfListAny)) - - val rangeFromListString = TypeRange(CTList(CTString), None) - (rangeFromListAny leastUpperBounds rangeFromListString) should equal(Seq(TypeRange(CTList(CTAny), CTList(CTString)), TypeRange(CTList(CTString), None))) - } - - test("should have indefinite size when allowing unbound any at any depth") { - TypeRange(CTAny, None).hasDefiniteSize should equal(false) - TypeRange(CTList(CTAny), None).hasDefiniteSize should equal(false) - - TypeRange(CTString, None).hasDefiniteSize should equal(true) - TypeRange(CTNumber, None).hasDefiniteSize should equal(true) - - TypeRange(CTAny, CTInteger).hasDefiniteSize should equal(true) - - TypeRange(CTList(CTList(CTAny)), None).hasDefiniteSize should equal(false) - TypeRange(CTList(CTList(CTString)), None).hasDefiniteSize should equal(true) - } - - test("should reparent into list") { - TypeRange(CTString, None).reparent(CTList) should equal(TypeRange(CTList(CTString), None)) - TypeRange(CTAny, CTNumber).reparent(CTList) should equal(TypeRange(CTList(CTAny), CTList(CTNumber))) - } - - test("without") { - TypeRange(CTAny, CTInteger).without(CTNumber) should equal(Some(TypeRange(CTAny, CTNumber.parentType))) - TypeRange(CTAny, CTNumber).without(CTInteger) should equal(Some(TypeRange(CTAny, CTNumber))) - TypeRange(CTAny, None).without(CTInteger) should equal(Some(TypeRange(CTAny, CTInteger.parentType))) - TypeRange(CTInteger, None).without(CTNumber) should equal(None) - TypeRange(CTInteger, None).without(CTString) should equal(Some(TypeRange(CTInteger, None))) - TypeRange(CTAny, CTNumber).without(CTString) should equal(Some(TypeRange(CTAny, CTNumber))) - } -} diff --git a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/symbols/TypeSpecTest.scala b/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/symbols/TypeSpecTest.scala deleted file mode 100644 index b100f94781ec5..0000000000000 --- a/community/cypher/frontend-3.5/src/test/scala/org/neo4j/cypher/internal/frontend/v3_5/symbols/TypeSpecTest.scala +++ /dev/null @@ -1,381 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.frontend.v3_5.symbols - -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite - -class TypeSpecTest extends CypherFunSuite { - - test("all types should contain all") { - TypeSpec.all contains CTAny should equal(true) - TypeSpec.all contains CTString should equal(true) - TypeSpec.all contains CTNumber should equal(true) - TypeSpec.all contains CTInteger should equal(true) - TypeSpec.all contains CTFloat should equal(true) - TypeSpec.all contains CTNode should equal(true) - TypeSpec.all contains CTList(CTAny) should equal(true) - TypeSpec.all contains CTList(CTFloat) should equal(true) - TypeSpec.all contains CTList(CTList(CTFloat)) should equal(true) - } - - test("should return true if contains") { - CTNumber.covariant contains CTInteger should equal(true) - CTNumber.covariant contains CTString should equal(false) - - val anyCollection = CTList(CTAny).covariant - anyCollection contains CTList(CTString) should equal(true) - anyCollection contains CTList(CTInteger) should equal(true) - anyCollection contains CTList(CTAny) should equal(true) - anyCollection contains CTList(CTList(CTInteger)) should equal(true) - anyCollection contains CTBoolean should equal(false) - anyCollection contains CTAny should equal(false) - } - - test("should return true if contains CTAny") { - TypeSpec.all containsAny TypeSpec.all should equal(true) - TypeSpec.all containsAny CTNumber.covariant should equal(true) - TypeSpec.all containsAny CTNode.invariant should equal(true) - CTNumber.covariant containsAny TypeSpec.all should equal(true) - - CTNumber.covariant containsAny CTInteger should equal(true) - CTInteger.covariant containsAny (CTInteger | CTString) should equal(true) - CTInteger.covariant containsAny CTNumber.covariant should equal(true) - CTInteger.covariant containsAny TypeSpec.all should equal(true) - - CTInteger.covariant containsAny CTString should equal(false) - CTNumber.covariant containsAny CTString should equal(false) - } - - test("should union") { - CTNumber.covariant | CTString.covariant should equal(CTNumber | CTFloat | CTInteger | CTString) - CTNumber.covariant | CTBoolean should equal(CTNumber | CTFloat | CTInteger | CTBoolean) - - CTNumber.covariant union CTList(CTString).covariant should equal(CTNumber | CTFloat | CTInteger | CTList(CTString)) - CTList(CTNumber) union CTList(CTString).covariant should equal(CTList(CTNumber) | CTList(CTString)) - } - - test("should intersect") { - TypeSpec.all & CTInteger should equal(CTInteger.invariant) - CTNumber.covariant & CTInteger should equal(CTInteger.invariant) - CTNumber.covariant & CTString should equal(TypeSpec.none) - - (CTNumber | CTInteger) & (CTAny | CTNumber) should equal(CTNumber.invariant) - CTNumber.contravariant & CTNumber.covariant should equal(CTNumber.invariant) - (CTNumber | CTInteger) & (CTNumber | CTFloat) should equal(CTNumber.invariant) - - CTList(CTList(CTAny)).contravariant intersect CTList(CTAny).covariant should equal(CTList(CTAny) | CTList(CTList(CTAny))) - - (CTNumber.covariant | CTList(CTAny).covariant) intersect (CTNumber.covariant | CTString.covariant) should equal(CTNumber.covariant) - } - - test("should constrain") { - CTInteger.covariant should equal(CTInteger.invariant) - CTNumber.covariant should equal(CTNumber | CTFloat | CTInteger) - - CTInteger constrain CTNumber should equal(CTInteger.invariant) - CTNumber.covariant constrain CTInteger should equal(CTInteger.invariant) - CTNumber constrain CTInteger should equal(TypeSpec.none) - - (CTInteger | CTString | CTMap) constrain CTNumber should equal(CTInteger.invariant) - (CTInteger | CTList(CTString)) constrain CTList(CTAny) should equal(CTList(CTString).invariant) - (CTInteger | CTList(CTMap)) constrain CTList(CTNode) should equal(TypeSpec.none) - (CTInteger | CTList(CTString)) constrain CTAny should equal(CTInteger | CTList(CTString)) - } - - test("constrain to branch type within list contains") { - TypeSpec.all constrain CTList(CTNumber) should equal(CTList(CTNumber) | CTList(CTInteger) | CTList(CTFloat)) - } - - test("constrain to sub type within list") { - CTList(CTAny).covariant constrain CTList(CTString) should equal(CTList(CTString).invariant) - } - - test("constrain to another branch") { - CTNumber.covariant constrain CTString should equal(TypeSpec.none) - - CTString.covariant constrain CTNumber should equal(TypeSpec.none) - } - - test("union two branches") { - CTNumber.covariant | CTString.covariant should equal(CTNumber | CTInteger | CTFloat | CTString) - } - - test("constrain to super type of some") { - (CTInteger | CTString) constrain CTNumber should equal(CTInteger.invariant) - CTInteger.contravariant constrain CTNumber should equal(CTNumber | CTInteger) - CTNumber.contravariant constrain CTNumber should equal(CTNumber.invariant) - CTNumber.contravariant constrain CTAny should equal(CTAny | CTNumber) - } - - test("constrain to CTAny") { - TypeSpec.all constrain CTAny should equal(TypeSpec.all) - CTNumber.covariant constrain CTAny should equal(CTNumber.covariant) - } - - test("constrain to sub type of some") { - val constrainedToNumberOrCollectionT = CTNumber.covariant | CTList(CTAny).covariant - constrainedToNumberOrCollectionT constrain CTList(CTNumber) should equal(CTList(CTNumber) | CTList(CTFloat) | CTList(CTInteger)) - } - - test("constrain to super type of none") { - CTNumber.contravariant constrain CTInteger should equal(TypeSpec.none) - CTNumber.contravariant constrain CTString should equal(TypeSpec.none) - } - - test("should find leastUpperBounds of TypeSpecs") { - (CTNode | CTNumber) leastUpperBounds (CTNode | CTNumber) should equal(CTNode | CTNumber | CTAny) - - (CTNode | CTNumber) leastUpperBounds (CTNode | CTNumber) should equal(CTNode | CTNumber | CTAny) - (CTNode | CTNumber) leastUpperBounds CTNumber should equal(CTNumber | CTAny) - (CTNode | CTNumber) leastUpperBounds (CTNode | CTNumber | CTRelationship) should equal(CTNode | CTNumber | CTMap | CTAny) - (CTNode | CTNumber) leastUpperBounds CTAny should equal(CTAny.invariant) - CTAny leastUpperBounds (CTNode | CTNumber) should equal(CTAny.invariant) - - CTRelationship.invariant leastUpperBounds CTNode.invariant should equal(CTMap.invariant) - (CTRelationship | CTInteger) leastUpperBounds (CTNode | CTNumber) should equal(CTMap | CTNumber | CTAny) - - (CTInteger | CTList(CTString)) leastUpperBounds (CTNumber | CTList(CTInteger)) should equal(CTNumber | CTList(CTAny) | CTAny) - } - - test("leastUpperBounds to root type") { - TypeSpec.all leastUpperBounds CTAny should equal(CTAny.invariant) - CTAny leastUpperBounds TypeSpec.all should equal(CTAny.invariant) - CTList(CTAny).covariant leastUpperBounds CTAny should equal(CTAny.invariant) - CTAny leastUpperBounds CTList(CTAny).covariant should equal(CTAny.invariant) - } - - test("leastUpperBounds with leaf type") { - TypeSpec.all leastUpperBounds CTInteger should equal(CTAny | CTNumber | CTInteger) - } - - test("leastUpperBounds with list") { - TypeSpec.all leastUpperBounds CTList(CTAny) should equal(CTAny | CTList(CTAny)) - TypeSpec.all leastUpperBounds CTList(CTString) should equal(CTAny | CTList(CTAny) | CTList(CTString)) - } - - test("leastUpperBounds with multiple types") { - TypeSpec.all leastUpperBounds (CTInteger | CTString) should equal(CTAny | CTNumber | CTInteger | CTString) - TypeSpec.all leastUpperBounds (CTList(CTString) | CTInteger) should equal(CTAny | CTNumber | CTInteger | CTList(CTAny) | CTList(CTString)) - } - - test("leastUpperBounds with some super types") { - (CTList(CTString) | CTInteger) leastUpperBounds CTNumber should equal(CTAny | CTNumber) - (CTList(CTString) | CTInteger) leastUpperBounds CTList(CTAny) should equal(CTAny | CTList(CTAny)) - - CTInteger leastUpperBounds CTNumber.covariant should equal(CTNumber | CTInteger) - - val mergedSet = CTList(CTList(CTAny)).covariant leastUpperBounds TypeSpec.all - mergedSet.contains(CTList(CTList(CTString))) should equal(true) - mergedSet.contains(CTList(CTList(CTInteger))) should equal(true) - mergedSet.contains(CTList(CTList(CTNumber))) should equal(true) - mergedSet.contains(CTList(CTList(CTAny))) should equal(true) - mergedSet.contains(CTList(CTString)) should equal(false) - mergedSet.contains(CTList(CTNumber)) should equal(false) - mergedSet.contains(CTList(CTAny)) should equal(true) - mergedSet.contains(CTString) should equal(false) - mergedSet.contains(CTNumber) should equal(false) - mergedSet.contains(CTAny) should equal(true) - - CTNumber.contravariant leastUpperBounds CTInteger.contravariant should equal(CTAny | CTNumber) - } - - test("leastUpperBounds with some sub types") { - (CTList(CTString) | CTNumber) leastUpperBounds CTInteger should equal(CTAny | CTNumber) - CTNumber.covariant leastUpperBounds CTInteger should equal(CTInteger | CTNumber) - - val numberOrCollectionT = CTNumber.covariant | CTList(CTAny).covariant - numberOrCollectionT leastUpperBounds CTInteger should equal(CTAny | CTNumber | CTInteger) - numberOrCollectionT leastUpperBounds CTList(CTInteger) should equal(CTAny | CTList(CTAny) | CTList(CTNumber) | CTList(CTInteger)) - - val listOfListOfAny = CTList(CTList(CTAny)).covariant - (TypeSpec.all leastUpperBounds listOfListOfAny) contains CTList(CTList(CTString)) should equal(true) - (TypeSpec.all leastUpperBounds listOfListOfAny) contains CTList(CTList(CTInteger)) should equal(true) - (TypeSpec.all leastUpperBounds listOfListOfAny) contains CTList(CTList(CTNumber)) should equal(true) - (TypeSpec.all leastUpperBounds listOfListOfAny) contains CTList(CTList(CTAny)) should equal(true) - (TypeSpec.all leastUpperBounds listOfListOfAny) contains CTList(CTString) should equal(false) - (TypeSpec.all leastUpperBounds listOfListOfAny) contains CTList(CTNumber) should equal(false) - (TypeSpec.all leastUpperBounds listOfListOfAny) contains CTList(CTAny) should equal(true) - (TypeSpec.all leastUpperBounds listOfListOfAny) contains CTString should equal(false) - (TypeSpec.all leastUpperBounds listOfListOfAny) contains CTNumber should equal(false) - (TypeSpec.all leastUpperBounds listOfListOfAny) contains CTAny should equal(true) - } - - test("leastUpperBounds of branch with sub type") { - CTNumber.covariant leastUpperBounds CTInteger should equal(CTNumber | CTInteger) - } - - test("leastUpperBounds of branch to branch root") { - CTNumber.covariant leastUpperBounds CTNumber should equal(CTNumber.invariant) - } - - test("leastUpperBounds of branch to super type") { - CTInteger.covariant leastUpperBounds CTNumber should equal(CTNumber.invariant) - } - - test("leastUpperBounds of branch to unrelated type") { - CTNumber.covariant leastUpperBounds CTString should equal(CTAny.invariant) - CTInteger.covariant leastUpperBounds CTString should equal(CTAny.invariant) - } - - test("leastUpperBounds with equivalent") { - CTNumber.covariant leastUpperBounds (CTNumber | CTInteger | CTFloat) should equal(CTNumber.covariant) - } - - test("should wrap in list") { - (CTString | CTList(CTNumber)).wrapInList should equal(CTList(CTString) | CTList(CTList(CTNumber))) - TypeSpec.all.wrapInList should equal(CTList(CTAny).covariant) - } - - test("should identify coercions") { - CTFloat.covariant.coercions should equal(TypeSpec.none) - CTInteger.covariant.coercions should equal(CTFloat.invariant) - (CTFloat | CTInteger).coercions should equal(CTFloat.invariant) - CTList(CTAny).covariant.coercions should equal(CTBoolean.invariant) - TypeSpec.exact(CTList(CTPath)).coercions should equal(CTBoolean.invariant) - CTList(CTAny).covariant.coercions should equal(CTBoolean.invariant) - TypeSpec.all.coercions should equal(TypeSpec.none) - CTInteger.contravariant.coercions should equal(TypeSpec.none) - } - - test("should intersect with coercions") { - TypeSpec.all intersectOrCoerce CTInteger should equal(CTInteger.invariant) - CTInteger intersectOrCoerce CTFloat should equal(CTFloat.invariant) - CTNumber intersectOrCoerce CTFloat should equal(TypeSpec.none) - CTList(CTAny).covariant intersectOrCoerce CTBoolean should equal(CTBoolean.invariant) - CTNumber.covariant intersectOrCoerce CTBoolean should equal(TypeSpec.none) - CTInteger intersectOrCoerce CTString should equal(TypeSpec.none) - } - - test("should constrain with coercions") { - TypeSpec.all constrainOrCoerce CTInteger should equal(CTInteger.invariant) - CTInteger constrainOrCoerce CTFloat should equal(CTFloat.invariant) - CTNumber constrainOrCoerce CTFloat should equal(TypeSpec.none) - CTList(CTAny).covariant constrainOrCoerce CTBoolean should equal(CTBoolean.invariant) - CTNumber.covariant constrainOrCoerce CTBoolean should equal(TypeSpec.none) - CTInteger constrainOrCoerce CTString should equal(TypeSpec.none) - } - - test("should leastUpperBound with coercions") { - CTInteger coerceOrLeastUpperBound CTFloat should equal(CTFloat.invariant) - CTNumber coerceOrLeastUpperBound CTFloat should equal(CTNumber.invariant) - CTList(CTAny).covariant coerceOrLeastUpperBound CTBoolean should equal(CTBoolean.invariant) - CTNumber.covariant coerceOrLeastUpperBound CTBoolean should equal(CTAny.invariant) - CTInteger coerceOrLeastUpperBound CTString should equal(CTAny.invariant) - } - - test("equal TypeSpecs should equal") { - CTString.invariant should equal(CTString.invariant) - - CTString.invariant should equal(CTString.covariant) - CTString.covariant should equal(CTString.invariant) - - CTFloat | CTInteger | CTNumber should equal(CTNumber | CTInteger | CTFloat) - CTNumber.covariant should equal(CTNumber | CTInteger | CTFloat) - CTNumber | CTInteger | CTFloat should equal(CTNumber.covariant) - - CTNumber.covariant | CTInteger.covariant should equal(CTNumber.covariant) - CTNumber.covariant | CTString.covariant should not equal(CTNumber.covariant) - - TypeSpec.all should equal(TypeSpec.all) - CTAny.covariant should equal(TypeSpec.all) - CTList(CTAny).covariant should equal(CTList(CTAny).covariant) - CTList(CTAny).covariant should equal(CTList(CTAny).covariant) - - TypeSpec.all | CTString.covariant should equal(TypeSpec.all) - TypeSpec.all | TypeSpec.all should equal(TypeSpec.all) - } - - test("different TypeSpecs should not equal") { - TypeSpec.all should not equal(CTNumber.covariant) - CTNumber.covariant should not equal(TypeSpec.all) - - CTList(CTAny).covariant should not equal(CTNumber.covariant) - CTNumber.covariant should not equal(CTList(CTAny).covariant) - - CTNumber.invariant should not equal(TypeSpec.all) - TypeSpec.all should not equal(CTNumber.invariant) - } - - test("should have indefinite size when allowing unconstrained any at any depth") { - TypeSpec.all.hasDefiniteSize should equal(false) - CTList(CTAny).covariant.hasDefiniteSize should equal(false) - - (CTString | CTNumber).hasDefiniteSize should equal(true) - CTList(CTString).covariant.hasDefiniteSize should equal(true) - - CTList(CTList(CTAny)).covariant.hasDefiniteSize should equal(false) - CTList(CTList(CTString)).covariant.hasDefiniteSize should equal(true) - - CTAny.contravariant.hasDefiniteSize should equal(true) - (CTList(CTAny).covariant leastUpperBounds CTList(CTAny)).hasDefiniteSize should equal(true) - } - - test("should be empty when no possibilities remain") { - TypeSpec.all.isEmpty should equal(false) - TypeSpec.none.isEmpty should equal(true) - (CTNumber.contravariant intersect CTInteger).isEmpty should equal(true) - } - - test("should format none") { - TypeSpec.none.mkString("(", ", ", " or ", ")") should equal("()") - } - - test("should format single type") { - CTAny.invariant.mkString("(", ", ", " or ", ")") should equal("(Any)") - CTNode.invariant.mkString("<", ", ", " and ", ">") should equal("") - } - - test("should format two types") { - (CTAny | CTNode).mkString("", ", ", " or ", "") should equal("Any or Node") - (CTRelationship | CTNode).mkString("-", ", ", " or ", "-") should equal("-Node or Relationship-") - } - - test("should format three types") { - (CTRelationship | CTInteger | CTNode).mkString(", ") should equal("Integer, Node, Relationship") - (CTRelationship | CTInteger | CTNode).mkString("(", ", ", ")") should equal("(Integer, Node, Relationship)") - (CTRelationship | CTAny | CTNode).mkString("(", ", ", " or ", ")") should equal("(Any, Node or Relationship)") - (CTRelationship | CTInteger | CTNode).mkString("[", ", ", " and ", "]") should equal("[Integer, Node and Relationship]") - } - - test("should format to string for indefinite sized set") { - TypeSpec.all.mkString(", ") should equal("T") - CTList(CTAny).covariant.mkString(", ") should equal("List") - (CTList(CTAny).covariant | CTBoolean).mkString(", ") should equal("Boolean, List") - (CTList(CTList(CTAny)).covariant | CTBoolean | CTList(CTString)).mkString(", ") should equal("Boolean, List, List>") - } - - test("should format to string for definite sized set") { - CTAny.invariant.mkString(", ") should equal("Any") - CTString.invariant.mkString(", ") should equal("String") - CTNumber.covariant.mkString(", ") should equal("Float, Integer, Number") - (CTNumber.covariant | CTBoolean.covariant).mkString(", ") should equal("Boolean, Float, Integer, Number") - CTNumber.contravariant.mkString(", ") should equal("Any, Number") - (CTBoolean.covariant | CTString.covariant | CTList(CTBoolean).covariant | CTList(CTString).covariant).mkString(", ") should equal("Boolean, String, List, List") - (CTBoolean.covariant | CTString.covariant | CTList(CTBoolean).covariant | CTList(CTList(CTString)).covariant).mkString(", ") should equal("Boolean, String, List, List>") - CTList(CTAny).contravariant.mkString(", ") should equal("Any, List") - } - - test("should iterate over definite sized set") { - CTString.invariant.iterator.toSeq should equal(Seq(CTString)) - CTNumber.covariant.iterator.toSeq should equal(Seq(CTFloat, CTInteger, CTNumber)) - (CTNumber.covariant | CTBoolean.covariant).iterator.toSeq should equal(Seq(CTBoolean, CTFloat, CTInteger, CTNumber)) - CTNumber.contravariant.iterator.toSeq should equal(Seq(CTAny, CTNumber)) - (CTBoolean | CTString | CTList(CTBoolean) | CTList(CTString)).iterator.toSeq should equal(Seq(CTBoolean, CTString, CTList(CTBoolean), CTList(CTString))) - (CTBoolean | CTString | CTList(CTBoolean) | CTList(CTList(CTString))).iterator.toSeq should equal(Seq(CTBoolean, CTString, CTList(CTBoolean), CTList(CTList(CTString)))) - } -} diff --git a/community/cypher/interpreted-runtime/LICENSES.txt b/community/cypher/interpreted-runtime/LICENSES.txt index 4f7f70dd7aff4..f0b791363a078 100644 --- a/community/cypher/interpreted-runtime/LICENSES.txt +++ b/community/cypher/interpreted-runtime/LICENSES.txt @@ -8,6 +8,12 @@ Apache Software License, Version 2.0 Lucene Core Lucene Memory Netty/All-in-One + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala ------------------------------------------------------------------------------ diff --git a/community/cypher/interpreted-runtime/NOTICE.txt b/community/cypher/interpreted-runtime/NOTICE.txt index 314af68a0ba65..5e08feb1227d6 100644 --- a/community/cypher/interpreted-runtime/NOTICE.txt +++ b/community/cypher/interpreted-runtime/NOTICE.txt @@ -31,6 +31,12 @@ Apache Software License, Version 2.0 Lucene Core Lucene Memory Netty/All-in-One + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala diff --git a/community/cypher/interpreted-runtime/pom.xml b/community/cypher/interpreted-runtime/pom.xml index 7a1575df7fa34..c902bf289c7b9 100644 --- a/community/cypher/interpreted-runtime/pom.xml +++ b/community/cypher/interpreted-runtime/pom.xml @@ -141,9 +141,9 @@ - org.neo4j - neo4j-cypher-util-3.5 - ${project.version} + org.opencypher + util-9.0 + ${openCypher.version} test-jar test diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/CSVResources.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/CSVResources.scala index ccf5008311294..d32d8e01c76d5 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/CSVResources.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/CSVResources.scala @@ -27,7 +27,7 @@ import java.util.zip.{GZIPInputStream, InflaterInputStream} import org.neo4j.csv.reader._ import org.neo4j.cypher.internal.runtime.interpreted.pipes.ExternalCSVResource -import org.neo4j.cypher.internal.util.v3_5.{LoadExternalResourceException, TaskCloser} +import org.opencypher.v9_0.util.{LoadExternalResourceException, TaskCloser} import sun.net.www.protocol.http.HttpURLConnection import scala.collection.mutable.ArrayBuffer diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/CastSupport.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/CastSupport.scala index d9a533a9f6849..9b6d72630bae5 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/CastSupport.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/CastSupport.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.interpreted import java.time._ import java.time.temporal.TemporalAmount -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.graphdb.spatial.Point import org.neo4j.values.storable.{ArrayValue, _} import org.neo4j.values.virtual._ diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/DelegatingQueryContext.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/DelegatingQueryContext.scala index 47bc124a051ad..5d12d5c7e566b 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/DelegatingQueryContext.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/DelegatingQueryContext.scala @@ -24,7 +24,7 @@ import java.net.URL import org.eclipse.collections.api.iterator.LongIterator import org.neo4j.cypher.internal.planner.v3_5.spi.{IndexDescriptor, KernelStatisticProvider} import org.neo4j.cypher.internal.runtime._ -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.cypher.internal.v3_5.logical.plans.QualifiedName import org.neo4j.graphdb.{Node, Path, PropertyContainer} import org.neo4j.internal.kernel.api.helpers.RelationshipSelectionCursor diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/ExecutionContext.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/ExecutionContext.scala index dfe7b154155cb..5ee41839ba4e9 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/ExecutionContext.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/ExecutionContext.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.util.InternalException import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values import org.neo4j.values.virtual._ diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/InterpretedPipeBuilder.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/InterpretedPipeBuilder.scala index c681d9c7d3d92..6f94a20f282ad 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/InterpretedPipeBuilder.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/InterpretedPipeBuilder.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5.VarPatternLength import org.neo4j.cypher.internal.planner.v3_5.spi.TokenContext import org.neo4j.cypher.internal.runtime.ProcedureCallMode @@ -29,8 +29,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.convert.PatternCon import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{AggregationExpression, Literal, ShortestPathExpression} import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.{Predicate, True} import org.neo4j.cypher.internal.runtime.interpreted.pipes._ -import org.neo4j.cypher.internal.util.v3_5.{Eagerly, InternalException} -import org.neo4j.cypher.internal.v3_5.expressions.{Equals => ASTEquals, Expression => ASTExpression, _} +import org.opencypher.v9_0.util.{Eagerly, InternalException} +import org.opencypher.v9_0.expressions.{Equals => ASTEquals, Expression => ASTExpression, _} import org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.v3_5.logical.plans.{ColumnOrder, Limit => LimitPlan, LoadCSV => LoadCSVPlan, Skip => SkipPlan, _} import org.neo4j.values.AnyValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/PatternGraphBuilder.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/PatternGraphBuilder.scala index ea9e6677af4de..115d6a3d2082c 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/PatternGraphBuilder.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/PatternGraphBuilder.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.interpreted import org.neo4j.cypher.internal.runtime.interpreted.commands.{Pattern, RelatedTo, VarLengthRelatedTo} import org.neo4j.cypher.internal.runtime.interpreted.pipes.matching.{PatternGraph, PatternNode, PatternRelationship} import org.neo4j.cypher.internal.runtime.interpreted.symbols.SymbolTable -import org.neo4j.cypher.internal.util.v3_5.SyntaxException +import org.opencypher.v9_0.util.SyntaxException import scala.collection.mutable diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/TransactionBoundGraphStatistics.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/TransactionBoundGraphStatistics.scala index cecd6b013ade3..a5e873079e6c5 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/TransactionBoundGraphStatistics.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/TransactionBoundGraphStatistics.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted import org.neo4j.cypher.internal.planner.v3_5.spi.{GraphStatistics, IndexDescriptor, StatisticsCompletingGraphStatistics} -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, LabelId, RelTypeId, Selectivity} +import org.opencypher.v9_0.util.{Cardinality, LabelId, RelTypeId, Selectivity} import org.neo4j.internal.kernel.api.{Read, SchemaRead} import org.neo4j.kernel.api.exceptions.index.IndexNotFoundKernelException import org.neo4j.kernel.impl.api.store.DefaultIndexReference diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/TransactionBoundPlanContext.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/TransactionBoundPlanContext.scala index 8e0e242c66a32..f729a51c256de 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/TransactionBoundPlanContext.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/TransactionBoundPlanContext.scala @@ -22,10 +22,10 @@ package org.neo4j.cypher.internal.runtime.interpreted import java.util.Optional import org.neo4j.cypher.MissingIndexException -import org.neo4j.cypher.internal.frontend.v3_5.phases.InternalNotificationLogger +import org.opencypher.v9_0.frontend.phases.InternalNotificationLogger import org.neo4j.cypher.internal.planner.v3_5.spi._ -import org.neo4j.cypher.internal.util.v3_5.CypherExecutionException -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.CypherExecutionException +import org.opencypher.v9_0.util.symbols._ import org.neo4j.cypher.internal.v3_5.logical.plans._ import org.neo4j.internal.kernel.api.exceptions.KernelException import org.neo4j.internal.kernel.api.procs.Neo4jTypes.AnyType diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/TransactionBoundQueryContext.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/TransactionBoundQueryContext.scala index a3bbf7ec18d2f..36b3176741d64 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/TransactionBoundQueryContext.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/TransactionBoundQueryContext.scala @@ -31,9 +31,9 @@ import org.neo4j.cypher.internal.runtime._ import org.neo4j.cypher.internal.runtime.interpreted.TransactionBoundQueryContext.IndexSearchMonitor import org.neo4j.cypher.internal.runtime.interpreted.commands.convert.DirectionConverter.toGraphDb import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{OnlyDirectionExpander, TypeAndDirectionExpander} -import org.neo4j.cypher.internal.util.v3_5.{EntityNotFoundException, FailedIndexException} -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection.{BOTH, INCOMING, OUTGOING} +import org.opencypher.v9_0.util.{EntityNotFoundException, FailedIndexException} +import org.opencypher.v9_0.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection.{BOTH, INCOMING, OUTGOING} import org.neo4j.cypher.internal.v3_5.logical.plans._ import org.neo4j.graphalgo.impl.path.ShortestPath import org.neo4j.graphalgo.impl.path.ShortestPath.ShortestPathPredicate diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/UpdateCountingQueryContext.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/UpdateCountingQueryContext.scala index 1a78a812a1c69..a8957cf605d70 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/UpdateCountingQueryContext.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/UpdateCountingQueryContext.scala @@ -23,7 +23,7 @@ import java.util.concurrent.atomic.AtomicInteger import org.neo4j.cypher.internal.planner.v3_5.spi.IndexDescriptor import org.neo4j.cypher.internal.runtime.{Operations, QueryContext, QueryStatistics} -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.values.storable.Value import org.neo4j.values.virtual.{RelationshipValue, NodeValue} diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/ValueConversion.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/ValueConversion.scala index 503bf5fe552fe..3e4b13f1962c5 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/ValueConversion.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/ValueConversion.scala @@ -22,8 +22,8 @@ package org.neo4j.cypher.internal.runtime.interpreted import java.time._ import java.time.temporal.TemporalAmount -import org.neo4j.cypher.internal.util.v3_5.Eagerly -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.Eagerly +import org.opencypher.v9_0.util.symbols._ import org.neo4j.graphdb.spatial.{Geometry, Point} import org.neo4j.graphdb.{Node, Path, Relationship} import org.neo4j.kernel.impl.util.ValueUtils diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/AstNode.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/AstNode.scala index 2fe8409a95324..53c45455fcc03 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/AstNode.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/AstNode.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import scala.reflect.ClassTag diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/PathExpression.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/PathExpression.scala index 7e1c14671840a..ade273dccfe22 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/PathExpression.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/PathExpression.scala @@ -26,8 +26,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.PatternGraphBuilder import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState import org.neo4j.cypher.internal.runtime.interpreted.pipes.matching.MatchingContext import org.neo4j.cypher.internal.runtime.interpreted.symbols.SymbolTable -import org.neo4j.cypher.internal.util.v3_5.UnNamedNameGenerator.isNamed -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.UnNamedNameGenerator.isNamed +import org.opencypher.v9_0.util.symbols._ import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values import org.neo4j.values.virtual.VirtualValues diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/Pattern.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/Pattern.scala index bd63ad4710fbf..e38d9cf4344d0 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/Pattern.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/Pattern.scala @@ -24,10 +24,10 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.True import org.neo4j.cypher.internal.runtime.interpreted.commands.values.KeyToken import org.neo4j.cypher.internal.runtime.interpreted.GraphElementPropertyFunctions import org.neo4j.cypher.internal.runtime.interpreted.symbols.TypeSafe -import org.neo4j.cypher.internal.util.v3_5.UnNamedNameGenerator -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection.{INCOMING, OUTGOING} +import org.opencypher.v9_0.util.UnNamedNameGenerator +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection.{INCOMING, OUTGOING} import scala.collection.{Map, Seq} trait Pattern extends TypeSafe with AstNode[Pattern] { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/ReturnItem.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/ReturnItem.scala index 70fdf7a7e82b3..5dab3cfc9a85c 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/ReturnItem.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/ReturnItem.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Expression, Variable} import org.neo4j.cypher.internal.runtime.interpreted.symbols.SymbolTable -import org.neo4j.cypher.internal.util.v3_5.UnNamedNameGenerator.isNamed +import org.opencypher.v9_0.util.UnNamedNameGenerator.isNamed import scala.collection.Map diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/SortItem.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/SortItem.scala index 6132d4f2eb49b..fde08896253e3 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/SortItem.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/SortItem.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands -import org.neo4j.cypher.internal.util.v3_5.PatternException +import org.opencypher.v9_0.util.PatternException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/coerce.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/coerce.scala index 2e534cdf77acb..80e9e4cba275f 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/coerce.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/coerce.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.{IsList, IsMap} -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.CypherTypeException +import org.opencypher.v9_0.util.symbols._ import org.neo4j.values._ import org.neo4j.values.storable._ import org.neo4j.values.virtual._ diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/convert/CommunityExpressionConverter.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/convert/CommunityExpressionConverter.scala index 37812e8a39e7a..d524c336bde46 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/convert/CommunityExpressionConverter.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/convert/CommunityExpressionConverter.scala @@ -19,17 +19,17 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.convert -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.DesugaredMapProjection import org.neo4j.cypher.internal.runtime.interpreted._ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{InequalitySeekRangeExpression, PointDistanceSeekRangeExpression, Expression => CommandExpression} import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.Predicate import org.neo4j.cypher.internal.runtime.interpreted.commands.values.TokenType.PropertyKey import org.neo4j.cypher.internal.runtime.interpreted.commands.values.UnresolvedRelType import org.neo4j.cypher.internal.runtime.interpreted.commands.{PathExtractorExpression, predicates, expressions => commandexpressions, values => commandvalues} -import org.neo4j.cypher.internal.util.v3_5.{InternalException, NonEmptyList} -import org.neo4j.cypher.internal.v3_5.functions._ +import org.opencypher.v9_0.util.{InternalException, NonEmptyList} +import org.opencypher.v9_0.expressions.functions._ +import org.opencypher.v9_0.expressions.{DesugaredMapProjection, functions} +import org.opencypher.v9_0.{expressions => ast} import org.neo4j.cypher.internal.v3_5.logical.plans._ -import org.neo4j.cypher.internal.v3_5.{functions, expressions => ast} object CommunityExpressionConverter extends ExpressionConverter { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/convert/ExpressionConverters.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/convert/ExpressionConverters.scala index fc36e41eb2204..0142be3681522 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/convert/ExpressionConverters.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/convert/ExpressionConverters.scala @@ -19,14 +19,14 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.convert -import org.neo4j.cypher.internal.util.v3_5._ +import org.opencypher.v9_0.util._ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.ProjectedPath._ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{ProjectedPath, Expression => CommandExpression} import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.Predicate import org.neo4j.cypher.internal.runtime.interpreted.pipes.{ManySeekArgs, SeekArgs, SingleSeekArg} -import org.neo4j.cypher.internal.v3_5.{expressions => ast} -import org.neo4j.cypher.internal.v3_5.expressions.{SemanticDirection, Variable} +import org.opencypher.v9_0.{expressions => ast} +import org.opencypher.v9_0.expressions.{SemanticDirection, Variable} import org.neo4j.cypher.internal.v3_5.logical.plans.{ManySeekableArgs, SeekableArgs, SingleSeekableArg} import org.neo4j.graphdb.Direction diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/convert/PatternConverters.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/convert/PatternConverters.scala index ef4e38fb7e5e4..b2da6a391c76f 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/convert/PatternConverters.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/convert/PatternConverters.scala @@ -19,12 +19,12 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.convert -import org.neo4j.cypher.internal.util.v3_5.{SyntaxException, UnNamedNameGenerator} +import org.opencypher.v9_0.util.{SyntaxException, UnNamedNameGenerator} import org.neo4j.cypher.internal.runtime.interpreted._ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Expression => CommandExpression} import org.neo4j.cypher.internal.runtime.interpreted.commands.values.KeyToken import org.neo4j.cypher.internal.runtime.interpreted.commands.{Pattern, SingleNode, values => commandvalues} -import org.neo4j.cypher.internal.v3_5.{expressions => ast} +import org.opencypher.v9_0.{expressions => ast} object PatternConverters { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Add.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Add.scala index c0cd9040b7d11..b53a064438e4d 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Add.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Add.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, IsList} -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.CypherTypeException +import org.opencypher.v9_0.util.symbols._ import org.neo4j.values._ import org.neo4j.values.storable.{UTF8StringValue, _} import org.neo4j.values.utils.UTF8Utils diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/AggregationExpression.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/AggregationExpression.scala index 5dcfed8e39db9..791968844bf5a 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/AggregationExpression.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/AggregationExpression.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.SyntaxException +import org.opencypher.v9_0.util.SyntaxException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState import org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation.AggregationFunction -import org.neo4j.cypher.internal.util.v3_5.symbols.CypherType +import org.opencypher.v9_0.util.symbols.CypherType abstract class AggregationExpression extends Expression { def apply(ctx: ExecutionContext, state: QueryState) = diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Avg.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Avg.scala index d48bfe758fa78..5312053b050b5 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Avg.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Avg.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation.AvgFunction -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ case class Avg(anInner: Expression) extends AggregationWithInnerExpression(anInner) { def createAggregationFunction = new AvgFunction(anInner) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/CoalesceFunction.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/CoalesceFunction.scala index 6a9aff0cae7c1..fd2e728520902 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/CoalesceFunction.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/CoalesceFunction.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/CoerceTo.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/CoerceTo.scala index 7088eb3d7bd60..dfc5e88bb6bb2 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/CoerceTo.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/CoerceTo.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.coerce import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ import org.neo4j.values.AnyValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Collect.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Collect.scala index 52aaafee5da5f..0ae8288d98e90 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Collect.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Collect.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation.CollectFunction -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ case class Collect(anInner: Expression) extends AggregationWithInnerExpression(anInner) { def createAggregationFunction = new CollectFunction(anInner) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ContainerIndex.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ContainerIndex.scala index 93085ada4d80a..6d4b5aec32c29 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ContainerIndex.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ContainerIndex.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.{CypherTypeException, InvalidArgumentException} +import org.opencypher.v9_0.util.{CypherTypeException, InvalidArgumentException} import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.{CastSupport, IsList, IsMap, ListSupport} import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Count.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Count.scala index 21d5929a43b1a..253d4da345f16 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Count.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Count.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation.CountFunction -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ case class Count(anInner: Expression) extends AggregationWithInnerExpression(anInner) { def createAggregationFunction = new CountFunction(anInner) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Distinct.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Distinct.scala index bed6b73292a84..6bdbd505274ff 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Distinct.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Distinct.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation.DistinctFunction -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ case class Distinct(innerAggregator: AggregationExpression, expression: Expression) extends AggregationWithInnerExpression(expression) { val expectedInnerType = CTAny diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Divide.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Divide.scala index 608a368a11e2f..c2fd4c6841609 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Divide.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Divide.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState -import org.neo4j.cypher.internal.util.v3_5.ArithmeticException +import org.opencypher.v9_0.util.ArithmeticException import org.neo4j.values._ import org.neo4j.values.storable._ diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Expression.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Expression.scala index 74fe7e38c4787..6c50dbf0e441c 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Expression.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Expression.scala @@ -24,8 +24,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.AstNode import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.{CoercedPredicate, Predicate} import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, QueryState} import org.neo4j.cypher.internal.runtime.interpreted.symbols.TypeSafe -import org.neo4j.cypher.internal.util.v3_5.symbols.CypherType -import org.neo4j.cypher.internal.util.v3_5.{CypherTypeException, InternalException} +import org.opencypher.v9_0.util.symbols.CypherType +import org.opencypher.v9_0.util.{CypherTypeException, InternalException} import org.neo4j.values.AnyValue import org.neo4j.values.storable.{NumberValue, Values} diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/GetDegree.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/GetDegree.scala index 0ee37599d2bae..8800618e11941 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/GetDegree.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/GetDegree.scala @@ -20,11 +20,11 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.QueryContext -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.values.KeyToken import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values import org.neo4j.values.virtual.NodeValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/IdFunction.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/IdFunction.scala index ee7dbe9e60c48..ab16ce07c1bb7 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/IdFunction.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/IdFunction.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState import org.neo4j.values.AnyValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/InequalitySeekRangeExpression.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/InequalitySeekRangeExpression.scala index abab2f78869ab..0b4b5ffef59c4 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/InequalitySeekRangeExpression.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/InequalitySeekRangeExpression.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.util.InternalException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState import org.neo4j.cypher.internal.v3_5.logical.plans.InequalitySeekRange diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/KeysFunction.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/KeysFunction.scala index f7ac3c92bf258..fca909b35fbe1 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/KeysFunction.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/KeysFunction.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.IsMap import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/LabelsFunction.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/LabelsFunction.scala index ee4d8a50d683d..d294b730cfcf7 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/LabelsFunction.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/LabelsFunction.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState -import org.neo4j.cypher.internal.util.v3_5.ParameterWrongTypeException +import org.opencypher.v9_0.util.ParameterWrongTypeException import org.neo4j.values.AnyValue import org.neo4j.values.virtual.NodeValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/MathFunction.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/MathFunction.scala index a13b6782a6aea..50631ec1f2206 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/MathFunction.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/MathFunction.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.{CypherTypeException, InvalidArgumentException} +import org.opencypher.v9_0.util.{CypherTypeException, InvalidArgumentException} import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ import org.neo4j.values._ import org.neo4j.values.storable._ import org.neo4j.values.virtual.VirtualValues diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Max.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Max.scala index ab7cc6115ac12..56e29c6eb10ad 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Max.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Max.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation.MaxFunction -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ case class Max(anInner: Expression) extends AggregationWithInnerExpression(anInner) { def createAggregationFunction = new MaxFunction(anInner) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Min.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Min.scala index feec9b7231e5c..1b53d003f226a 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Min.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Min.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation.MinFunction -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ case class Min(anInner: Expression) extends AggregationWithInnerExpression(anInner) { def createAggregationFunction = new MinFunction(anInner) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/NodesFunction.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/NodesFunction.scala index 60dcbf87363a5..4d0d40647fb8c 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/NodesFunction.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/NodesFunction.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.SyntaxException +import org.opencypher.v9_0.util.SyntaxException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState import org.neo4j.values.AnyValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Percentile.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Percentile.scala index 306974b676c37..2ff7261c63e10 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Percentile.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Percentile.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation.{PercentileContFunction, PercentileDiscFunction} -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ case class PercentileCont(anInner: Expression, percentile: Expression) extends AggregationWithInnerExpression(anInner) { def createAggregationFunction = new PercentileContFunction(anInner, percentile) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PointDistanceSeekRangeExpression.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PointDistanceSeekRangeExpression.scala index 097b843461175..88f2e6cf7f23f 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PointDistanceSeekRangeExpression.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PointDistanceSeekRangeExpression.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.util.InternalException import org.neo4j.cypher.internal.v3_5.logical.plans.PointDistanceRange import org.neo4j.values.AnyValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PointFunction.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PointFunction.scala index a04099a9a02bd..3540dbac7b473 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PointFunction.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PointFunction.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import java.util.function.BiConsumer -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.IsMap import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PrefixSeekRangeExpression.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PrefixSeekRangeExpression.scala index cedead867a9d4..e37ed6c102e37 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PrefixSeekRangeExpression.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PrefixSeekRangeExpression.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.util.InternalException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState import org.neo4j.cypher.internal.v3_5.logical.plans.PrefixRange diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PropertiesFunction.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PropertiesFunction.scala index 71f5112b8148c..28bc50b7f379f 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PropertiesFunction.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PropertiesFunction.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.IsMap import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Property.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Property.scala index ffc57749e5d7d..4f9ddd24b9334 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Property.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Property.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.{CypherTypeException, InvalidArgumentException} +import org.opencypher.v9_0.util.{CypherTypeException, InvalidArgumentException} import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.values.KeyToken import org.neo4j.cypher.internal.runtime.interpreted.IsMap diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ReduceFunction.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ReduceFunction.scala index 2fbc6588188bf..d07640af1cf68 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ReduceFunction.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ReduceFunction.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.ListSupport import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ import org.neo4j.values.AnyValue case class ReduceFunction(collection: Expression, id: String, expression: Expression, acc: String, init: Expression) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/RelationshipFunction.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/RelationshipFunction.scala index 9cd8ac0852c4b..c8faf56083037 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/RelationshipFunction.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/RelationshipFunction.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.SyntaxException +import org.opencypher.v9_0.util.SyntaxException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState import org.neo4j.values.AnyValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/RelationshipTypeFunction.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/RelationshipTypeFunction.scala index cb1235da46858..390ecd5ecdec7 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/RelationshipTypeFunction.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/RelationshipTypeFunction.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.ParameterWrongTypeException +import org.opencypher.v9_0.util.ParameterWrongTypeException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState import org.neo4j.values.AnyValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ReverseFunction.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ReverseFunction.scala index 8d510dba35070..10e1fc3dcafa6 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ReverseFunction.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ReverseFunction.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.values.AnyValue import org.neo4j.values.storable.{TextValue, Values} import org.neo4j.values.virtual.{ListValue, VirtualValues} diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ShortestPathExpression.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ShortestPathExpression.scala index 1328738777b4c..64414efa07f94 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ShortestPathExpression.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ShortestPathExpression.scala @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates._ import org.neo4j.cypher.internal.runtime.interpreted.commands.{Pattern, ShortestPath, SingleNode, _} import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState import org.neo4j.cypher.internal.runtime.{Expander, KernelPredicate} -import org.neo4j.cypher.internal.util.v3_5.{NonEmptyList, ShortestPathCommonEndNodesForbiddenException, SyntaxException} +import org.opencypher.v9_0.util.{NonEmptyList, ShortestPathCommonEndNodesForbiddenException, SyntaxException} import org.neo4j.graphdb.{Path, PropertyContainer, Relationship} import org.neo4j.kernel.impl.util.ValueUtils import org.neo4j.values.AnyValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ShortestPathSPI.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ShortestPathSPI.scala index bedd229b75136..b0d25cf0d705d 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ShortestPathSPI.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ShortestPathSPI.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.{Expander, KernelPredicate} -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.graphdb.{Node, Path, PropertyContainer} abstract class BaseExpander() extends Expander { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/SizeFunction.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/SizeFunction.scala index 2e3baa0eca4ea..f2ec954fbabfc 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/SizeFunction.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/SizeFunction.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.ListSupport import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Stdev.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Stdev.scala index 541e795a876d9..021cf71bb7fd9 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Stdev.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Stdev.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation.StdevFunction -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ case class Stdev(anInner: Expression) extends AggregationWithInnerExpression(anInner) { def createAggregationFunction = new StdevFunction(anInner, false) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/StringFunctions.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/StringFunctions.scala index b254d51364a7d..b6cdac67f6310 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/StringFunctions.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/StringFunctions.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.{CypherTypeException, ParameterWrongTypeException} +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.{CypherTypeException, ParameterWrongTypeException} import org.neo4j.values._ import org.neo4j.values.storable.Values.NO_VALUE import org.neo4j.values.storable._ diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Subtract.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Subtract.scala index ee739d2017a7f..af3f931a5765d 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Subtract.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Subtract.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.values.AnyValue import org.neo4j.values.storable.{DurationValue, NumberValue, TemporalValue} diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Sum.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Sum.scala index dfbe4b5724367..b16fffb9a78e4 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Sum.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/Sum.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation.SumFunction -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ case class Sum(anInner: Expression) extends AggregationWithInnerExpression(anInner) { def createAggregationFunction = new SumFunction(anInner) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/TimestampFunction.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/TimestampFunction.scala index 6ee0a5b3a13e5..e1a747b316960 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/TimestampFunction.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/TimestampFunction.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToBooleanFunction.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToBooleanFunction.scala index 27c1bb5d82d8b..6a4f3cfbd2798 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToBooleanFunction.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToBooleanFunction.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.ParameterWrongTypeException +import org.opencypher.v9_0.util.ParameterWrongTypeException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState import org.neo4j.values.AnyValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToFloatFunction.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToFloatFunction.scala index fd686a2b779ee..3e4ed11ff8fa7 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToFloatFunction.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToFloatFunction.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.ParameterWrongTypeException +import org.opencypher.v9_0.util.ParameterWrongTypeException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState import org.neo4j.values._ diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToIntegerFunction.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToIntegerFunction.scala index a791a07f3902c..240d1416fd5a2 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToIntegerFunction.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToIntegerFunction.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.{CypherTypeException, ParameterWrongTypeException} +import org.opencypher.v9_0.util.{CypherTypeException, ParameterWrongTypeException} import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState import org.neo4j.values._ diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/Ands.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/Ands.scala index 3999575b7f8ae..b045c61bb052a 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/Ands.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/Ands.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.predicates -import org.neo4j.cypher.internal.util.v3_5.NonEmptyList +import org.opencypher.v9_0.util.NonEmptyList import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Expression, Property, Variable} import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/Ors.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/Ors.scala index 20cdb463c5e77..c953e9bd02e6f 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/Ors.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/Ors.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.predicates -import org.neo4j.cypher.internal.util.v3_5.NonEmptyList +import org.opencypher.v9_0.util.NonEmptyList import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/Predicate.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/Predicate.scala index eb75ee9215f21..7e671f4eda8e2 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/Predicate.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/Predicate.scala @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Expre import org.neo4j.cypher.internal.runtime.interpreted.commands.values.KeyToken import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState import org.neo4j.cypher.internal.runtime.interpreted.{CastSupport, ExecutionContext, IsList, IsMap} -import org.neo4j.cypher.internal.util.v3_5.{CypherTypeException, NonEmptyList} +import org.opencypher.v9_0.util.{CypherTypeException, NonEmptyList} import org.neo4j.values.storable.{BooleanValue, TextValue, Value, Values} import org.neo4j.values.virtual.{VirtualRelationshipValue, VirtualNodeValue} diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/groupInequalityPredicatesForLegacy.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/groupInequalityPredicatesForLegacy.scala index 355972c41d19d..15a96ec98ffd7 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/groupInequalityPredicatesForLegacy.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/groupInequalityPredicatesForLegacy.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.predicates -import org.neo4j.cypher.internal.util.v3_5.NonEmptyList +import org.opencypher.v9_0.util.NonEmptyList import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Property, Variable} // This transforms diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/makeValueNeoSafe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/makeValueNeoSafe.scala index cc2555cff8791..0d3f0b532d104 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/makeValueNeoSafe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/makeValueNeoSafe.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.values.AnyValue import org.neo4j.values.storable.{ArrayValue, Value, Values} import org.neo4j.values.virtual.ListValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ActiveReadPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ActiveReadPipe.scala index d8d7ab115d39b..464de67e17093 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ActiveReadPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ActiveReadPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class ActiveReadPipe(source: Pipe)(val id: Id = Id.INVALID_ID) extends Pipe { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/AllNodesScanPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/AllNodesScanPipe.scala index 60c38ce985c17..f4a8fa15130d2 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/AllNodesScanPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/AllNodesScanPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class AllNodesScanPipe(ident: String)(val id: Id = Id.INVALID_ID) extends Pipe { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ApplyPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ApplyPipe.scala index 072efebf107d5..a842014cc77b9 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ApplyPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ApplyPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class ApplyPipe(source: Pipe, inner: Pipe)(val id: Id = Id.INVALID_ID) extends PipeWithSource(source) { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/AssertSameNodePipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/AssertSameNodePipe.scala index eb2dd67298792..0e3f06e1e8ff7 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/AssertSameNodePipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/AssertSameNodePipe.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.pipes -import org.neo4j.cypher.internal.util.v3_5.MergeConstraintConflictException +import org.opencypher.v9_0.util.MergeConstraintConflictException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.CastSupport -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.virtual.VirtualNodeValue case class AssertSameNodePipe(source: Pipe, inner: Pipe, node: String) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/CachingExpandInto.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/CachingExpandInto.scala index 267a643cfb6c3..26465788bc670 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/CachingExpandInto.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/CachingExpandInto.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.helpers.collection.PrefetchingIterator import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values.NO_VALUE diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/CartesianProductPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/CartesianProductPipe.scala index f047afd88bcce..752889b1762ce 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/CartesianProductPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/CartesianProductPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class CartesianProductPipe(lhs: Pipe, rhs: Pipe) (val id: Id = Id.INVALID_ID) extends Pipe { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ConditionalApplyPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ConditionalApplyPipe.scala index 8e2fe46052ac4..aaa6cc45fe1a2 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ConditionalApplyPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ConditionalApplyPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.storable.Values case class ConditionalApplyPipe(source: Pipe, inner: Pipe, items: Seq[String], negated: Boolean) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ConstraintOperationPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ConstraintOperationPipe.scala index 9196d7c9186d1..090ed651fb43a 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ConstraintOperationPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ConstraintOperationPipe.scala @@ -23,7 +23,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands._ import org.neo4j.cypher.internal.runtime.interpreted.commands.values.KeyToken import org.neo4j.cypher.internal.planner.v3_5.spi.IndexDescriptor -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id class ConstraintOperationPipe(op: PropertyConstraintOperation, keyToken: KeyToken, propertyKey: KeyToken) (val id: Id = Id.INVALID_ID) extends Pipe { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/CreateNodePipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/CreateNodePipe.scala index 54899dd3abac6..c4d67bafa182c 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/CreateNodePipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/CreateNodePipe.scala @@ -22,10 +22,10 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import java.util.function.BiConsumer import org.neo4j.cypher.internal.runtime.QueryContext -import org.neo4j.cypher.internal.util.v3_5.{CypherTypeException, InvalidSemanticsException} +import org.opencypher.v9_0.util.{CypherTypeException, InvalidSemanticsException} import org.neo4j.cypher.internal.runtime.interpreted._ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.kernel.impl.util.ValueUtils import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/CreateRelationshipPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/CreateRelationshipPipe.scala index 7f5c57fe3d8b6..9eac106583a8c 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/CreateRelationshipPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/CreateRelationshipPipe.scala @@ -24,8 +24,8 @@ import java.util.function.BiConsumer import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted._ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.{CypherTypeException, InternalException, InvalidSemanticsException} +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.{CypherTypeException, InternalException, InvalidSemanticsException} import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values import org.neo4j.values.virtual.{RelationshipValue, NodeValue} diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DeletePipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DeletePipe.scala index b5c17d744a4bb..89b26bd80bf05 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DeletePipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DeletePipe.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.pipes -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.GraphElementPropertyFunctions -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.storable.Values import org.neo4j.values.virtual.{RelationshipValue, NodeValue, PathValue} diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DirectedRelationshipByIdSeekPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DirectedRelationshipByIdSeekPipe.scala index d9b9db39f3cc2..12d155f6430c9 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DirectedRelationshipByIdSeekPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DirectedRelationshipByIdSeekPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.virtual.VirtualValues import scala.collection.JavaConverters._ diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DistinctPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DistinctPipe.scala index 746e536ecc5a1..d20fe2e806108 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DistinctPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DistinctPipe.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.Eagerly -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.Eagerly +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.AnyValue import org.neo4j.values.virtual.VirtualValues diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DropResultPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DropResultPipe.scala index cc5ad2442cffb..9a8723b563126 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DropResultPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DropResultPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class DropResultPipe(source: Pipe)(val id: Id = Id.INVALID_ID) extends Pipe { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/EagerAggregationPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/EagerAggregationPipe.scala index 39ccdc5b8ea04..33364b275eca7 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/EagerAggregationPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/EagerAggregationPipe.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, MutableMaps} import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{AggregationExpression, Expression} import org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation.AggregationFunction -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.AnyValue import org.neo4j.values.virtual.{ListValue, MapValue, VirtualValues} diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/EagerPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/EagerPipe.scala index ad099f943bd26..328ef5d40ac28 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/EagerPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/EagerPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class EagerPipe(src: Pipe)(val id: Id = Id.INVALID_ID) extends PipeWithSource(src) { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/EmptyResultPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/EmptyResultPipe.scala index 4c68c01ac7eed..4c4b353ffbe10 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/EmptyResultPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/EmptyResultPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class EmptyResultPipe(source: Pipe)(val id: Id = Id.INVALID_ID) extends PipeWithSource(source) { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ErrorPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ErrorPipe.scala index eddb49a1259f7..d9739da9f5eb6 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ErrorPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ErrorPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class ErrorPipe(source: Pipe, exception: Exception) (val id: Id = Id.INVALID_ID) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ExpandAllPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ExpandAllPipe.scala index e859a5a365ebd..18d707064a93d 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ExpandAllPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ExpandAllPipe.scala @@ -20,9 +20,9 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values import org.neo4j.values.virtual.{RelationshipValue, NodeValue} diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ExpandIntoPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ExpandIntoPipe.scala index 7bfa6e9f98d03..2b1ea4ddcf555 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ExpandIntoPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ExpandIntoPipe.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.InternalException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.values.storable.Values import org.neo4j.values.virtual.NodeValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/FilterPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/FilterPipe.scala index c18a7bc031014..6d840674e96a3 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/FilterPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/FilterPipe.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.Predicate -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class FilterPipe(source: Pipe, predicate: Predicate) (val id: Id = Id.INVALID_ID) extends PipeWithSource(source) { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ForeachPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ForeachPipe.scala index c41f1f1c36856..3fc3250c73617 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ForeachPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ForeachPipe.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.ListSupport -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import scala.collection.JavaConverters._ diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/IndexOperationPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/IndexOperationPipe.scala index 2322d115440e5..557b90798b567 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/IndexOperationPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/IndexOperationPipe.scala @@ -20,10 +20,10 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.planner.v3_5.spi.IndexDescriptor -import org.neo4j.cypher.internal.util.v3_5.SyntaxException +import org.opencypher.v9_0.util.SyntaxException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.{CreateIndex, DropIndex, IndexOperation} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class IndexOperationPipe(indexOp: IndexOperation)(val id: Id = Id.INVALID_ID) extends Pipe { protected def internalCreateResults(state: QueryState): Iterator[ExecutionContext] = { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/IndexSeekMode.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/IndexSeekMode.scala index b8ac07c17ab05..23ecd8ed04396 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/IndexSeekMode.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/IndexSeekMode.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.pipes -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.util.InternalException import org.neo4j.cypher.internal.v3_5.logical.plans.{QueryExpression, RangeQueryExpression} import org.neo4j.values.virtual.NodeValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyLabel.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyLabel.scala index a15de7d4c6a2f..5296740d24d8b 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyLabel.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyLabel.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.pipes -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.planner.v3_5.spi.TokenContext import org.neo4j.cypher.internal.runtime.QueryContext -import org.neo4j.cypher.internal.util.v3_5.LabelId -import org.neo4j.cypher.internal.v3_5.expressions.LabelName +import org.opencypher.v9_0.util.LabelId +import org.opencypher.v9_0.expressions.LabelName case class LazyLabel(name: String) { private var id: Option[LabelId] = None diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyPropertyKey.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyPropertyKey.scala index d5ad4e8bdc773..0304d158f0d09 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyPropertyKey.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyPropertyKey.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.pipes -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.planner.v3_5.spi.TokenContext -import org.neo4j.cypher.internal.util.v3_5.PropertyKeyId -import org.neo4j.cypher.internal.v3_5.expressions.PropertyKeyName +import org.opencypher.v9_0.util.PropertyKeyId +import org.opencypher.v9_0.expressions.PropertyKeyName case class LazyPropertyKey(name: String) { private var id: Option[PropertyKeyId] = None diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyType.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyType.scala index 7d29564f8c72c..9cdad223e9fa4 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyType.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyType.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.pipes -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.runtime.QueryContext -import org.neo4j.cypher.internal.v3_5.expressions.RelTypeName +import org.opencypher.v9_0.expressions.RelTypeName case class LazyType(name: String) { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyTypes.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyTypes.scala index c64cb4b0f0f11..d1118a59fcb21 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyTypes.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyTypes.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.pipes -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.runtime.QueryContext -import org.neo4j.cypher.internal.v3_5.expressions.RelTypeName +import org.opencypher.v9_0.expressions.RelTypeName final class LazyTypes(val names: Array[String]) { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LetSelectOrSemiApplyPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LetSelectOrSemiApplyPipe.scala index e863e6a5b9d97..e4ba381c5a9cf 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LetSelectOrSemiApplyPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LetSelectOrSemiApplyPipe.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.Predicate -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.storable.Values case class LetSelectOrSemiApplyPipe(source: Pipe, inner: Pipe, letVarName: String, predicate: Predicate, negated: Boolean) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LetSemiApplyPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LetSemiApplyPipe.scala index 89cfb66953903..92bdfafcd1d23 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LetSemiApplyPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LetSemiApplyPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.storable.Values case class LetSemiApplyPipe(source: Pipe, inner: Pipe, letVarName: String, negated: Boolean) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LimitPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LimitPipe.scala index c8c50a6ea541d..8258ed72f58c2 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LimitPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LimitPipe.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Expression, NumericHelper} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import scala.collection.Iterator.empty diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LoadCSVPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LoadCSVPipe.scala index 2217f58c00d61..419f0b7e8ba1d 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LoadCSVPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LoadCSVPipe.scala @@ -22,12 +22,12 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import java.net.URL import java.util -import org.neo4j.cypher.internal.util.v3_5.LoadExternalResourceException +import org.opencypher.v9_0.util.LoadExternalResourceException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.ir.v3_5.{CSVFormat, HasHeaders, NoHeaders} import org.neo4j.cypher.internal.runtime.{ArrayBackedMap, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values._ import org.neo4j.values.storable.{TextValue, Value, Values} import org.neo4j.values.virtual.VirtualValues diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LockNodesPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LockNodesPipe.scala index 034263be6b4ea..029eed2d32c99 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LockNodesPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LockNodesPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.virtual.VirtualNodeValue case class LockNodesPipe(src: Pipe, variablesToLock: Set[String])(val id: Id = Id.INVALID_ID) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NestedPipeExpression.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NestedPipeExpression.scala index 897cf05542c64..6d0960458ec8a 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NestedPipeExpression.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NestedPipeExpression.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.pipes -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.frontend.v3_5.SemanticCheck -import org.neo4j.cypher.internal.v3_5.expressions.Expression -import org.neo4j.cypher.internal.v3_5.expressions.Expression.SemanticContext -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticCheckResult +import org.opencypher.v9_0.util.InputPosition +import org.opencypher.v9_0.ast.semantics.SemanticCheck +import org.opencypher.v9_0.expressions.Expression +import org.opencypher.v9_0.expressions.Expression.SemanticContext +import org.opencypher.v9_0.ast.semantics.SemanticCheckResult case class NestedPipeExpression(pipe: Pipe, projection: Expression)(val position: InputPosition) extends Expression { def semanticCheck(ctx: SemanticContext): SemanticCheck = SemanticCheckResult.success diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeByIdSeekPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeByIdSeekPipe.scala index bac26be30f585..dc790759d1ba8 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeByIdSeekPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeByIdSeekPipe.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.IsList -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.virtual.{ListValue, VirtualValues} import scala.collection.JavaConverters._ diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeByLabelScanPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeByLabelScanPipe.scala index e2946c4780a81..b62a5e64849b7 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeByLabelScanPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeByLabelScanPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class NodeByLabelScanPipe(ident: String, label: LazyLabel) (val id: Id = Id.INVALID_ID) extends Pipe { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeCountFromCountStorePipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeCountFromCountStorePipe.scala index 7fb1404bb90e4..687bc8f0aefd5 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeCountFromCountStorePipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeCountFromCountStorePipe.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.NameId -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.NameId +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.storable.Values case class NodeCountFromCountStorePipe(ident: String, labels: List[Option[LazyLabel]]) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeHashJoinPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeHashJoinPipe.scala index 94026a2095899..d2344c150482c 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeHashJoinPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeHashJoinPipe.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.pipes -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.storable.Values import org.neo4j.values.virtual.VirtualNodeValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexContainsScanPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexContainsScanPipe.scala index 7db0b9d607b2f..5d752fca5b679 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexContainsScanPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexContainsScanPipe.scala @@ -22,9 +22,9 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.v3_5.expressions.{LabelToken, PropertyKeyToken} +import org.opencypher.v9_0.util.CypherTypeException +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.expressions.{LabelToken, PropertyKeyToken} import org.neo4j.internal.kernel.api.{CapableIndexReference, IndexReference} import org.neo4j.values.storable.{TextValue, Values} import org.neo4j.values.virtual.NodeValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexScanPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexScanPipe.scala index d84d5bdb1fa6a..97458a6fbe9cd 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexScanPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexScanPipe.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.v3_5.expressions.{LabelToken, PropertyKeyToken} +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.expressions.{LabelToken, PropertyKeyToken} import org.neo4j.internal.kernel.api.{CapableIndexReference, IndexReference} case class NodeIndexScanPipe(ident: String, diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexSeekPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexSeekPipe.scala index 35ef1308aae0b..e23771269f17b 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexSeekPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexSeekPipe.scala @@ -22,8 +22,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.v3_5.expressions.{LabelToken, PropertyKeyToken} +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.expressions.{LabelToken, PropertyKeyToken} import org.neo4j.cypher.internal.v3_5.logical.plans._ import org.neo4j.internal.kernel.api.{CapableIndexReference, IndexReference} diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexSeeker.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexSeeker.scala index 53cd8380065ec..2cc49e0c4c5cc 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexSeeker.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexSeeker.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.pipes -import org.neo4j.cypher.internal.frontend.v3_5.helpers.SeqCombiner.combine +import org.opencypher.v9_0.frontend.helpers.SeqCombiner.combine import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Expression, InequalitySeekRangeExpression, PointDistanceSeekRangeExpression, PrefixSeekRangeExpression} import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, IsList, makeValueNeoSafe} -import org.neo4j.cypher.internal.util.v3_5.{CypherTypeException, InternalException} +import org.opencypher.v9_0.util.{CypherTypeException, InternalException} import org.neo4j.cypher.internal.v3_5.logical.plans._ import org.neo4j.internal.kernel.api.{IndexQuery, IndexReference} import org.neo4j.values.AnyValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeLeftOuterHashJoinPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeLeftOuterHashJoinPipe.scala index 20f95a918e130..0e81873c20c5c 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeLeftOuterHashJoinPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeLeftOuterHashJoinPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import scala.collection.mutable diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeRightOuterHashJoinPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeRightOuterHashJoinPipe.scala index 1d7c16a514921..c61b9dae786d6 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeRightOuterHashJoinPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeRightOuterHashJoinPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class NodeRightOuterHashJoinPipe(nodeVariables: Set[String], lhs: Pipe, rhs: Pipe, nullableVariables: Set[String]) (val id: Id = Id.INVALID_ID) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalExpandAllPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalExpandAllPipe.scala index 6a42e43620025..f8066f22a7074 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalExpandAllPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalExpandAllPipe.scala @@ -21,9 +21,9 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.Predicate -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values import org.neo4j.values.virtual.NodeValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalExpandIntoPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalExpandIntoPipe.scala index a5c589e6cda4a..1342393e438ec 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalExpandIntoPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalExpandIntoPipe.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.Predicate -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.values.storable.Values import org.neo4j.values.virtual.NodeValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalPipe.scala index 6f9e1f993c3f3..4c5d387d073bb 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.storable.Values case class OptionalPipe(nullableVariables: Set[String], source: Pipe) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/Pipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/Pipe.scala index ad8b80454a48c..bb5a230354505 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/Pipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/Pipe.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.Unchangeable -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.Unchangeable +import org.opencypher.v9_0.util.attribution.Id /** * Pipe is a central part of Cypher. Most pipes are decorators - they diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/PipeBuilderFactory.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/PipeBuilderFactory.scala index c44defd6813ae..8772e5b6cfd33 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/PipeBuilderFactory.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/PipeBuilderFactory.scala @@ -21,9 +21,9 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.planner.v3_5.spi.TokenContext import org.neo4j.cypher.internal.runtime.interpreted.commands.convert.ExpressionConverters -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, bottomUp} +import org.opencypher.v9_0.util.{Rewriter, bottomUp} import org.neo4j.cypher.internal.v3_5.logical.plans.{LogicalPlan, NestedPlanExpression} -import org.neo4j.cypher.internal.v3_5.{expressions => frontEndAst} +import org.opencypher.v9_0.{expressions => frontEndAst} trait PipeBuilderFactory { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/PipeExecutionBuilderContext.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/PipeExecutionBuilderContext.scala index 4078836eb914d..4b398288ec5a6 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/PipeExecutionBuilderContext.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/PipeExecutionBuilderContext.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.pipes -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities case class PipeExecutionBuilderContext(semanticTable: SemanticTable, diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProcedureCallPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProcedureCallPipe.scala index 9eaec2f55d0a2..80a927b0f3b49 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProcedureCallPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProcedureCallPipe.scala @@ -22,8 +22,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, ValueConversion} import org.neo4j.cypher.internal.runtime.{ProcedureCallMode, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.symbols.CypherType +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.symbols.CypherType import org.neo4j.cypher.internal.v3_5.logical.plans.ProcedureSignature import org.neo4j.values.AnyValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProduceResultsPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProduceResultsPipe.scala index e1b39a27e4147..d911e798e5d19 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProduceResultsPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProduceResultsPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, MutableMaps} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class ProduceResultsPipe(source: Pipe, columns: Seq[String]) (val id: Id = Id.INVALID_ID) extends PipeWithSource(source) { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProjectEndpointsPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProjectEndpointsPipe.scala index a00288800021e..ab255fc29c0df 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProjectEndpointsPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProjectEndpointsPipe.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, ListSupport} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.virtual.VirtualValues.reverse import org.neo4j.values.virtual.{RelationshipReference, RelationshipValue, ListValue, NodeValue} diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProjectionPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProjectionPipe.scala index 45ec2729936f6..e19362cd7a9b9 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProjectionPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProjectionPipe.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class ProjectionPipe(source: Pipe, expressions: Map[String, Expression]) (val id: Id = Id.INVALID_ID) extends PipeWithSource(source) { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/PruningVarLengthExpandPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/PruningVarLengthExpandPipe.scala index 849686d4cd509..992939c3c276e 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/PruningVarLengthExpandPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/PruningVarLengthExpandPipe.scala @@ -21,9 +21,9 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.eclipse.collections.impl.map.mutable.primitive.LongObjectHashMap import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.values.storable.{Value, Values} import org.neo4j.values.virtual.{RelationshipValue, VirtualNodeValue} diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/QueryState.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/QueryState.scala index f9e93f03512a4..1a793f0bf3908 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/QueryState.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/QueryState.scala @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.PathVa import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.{InCheckContainer, SingleThreadedLRUCache} import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, MapExecutionContext, MutableMaps} import org.neo4j.cypher.internal.runtime.{QueryContext, QueryStatistics} -import org.neo4j.cypher.internal.util.v3_5.ParameterNotFoundException +import org.opencypher.v9_0.util.ParameterNotFoundException import org.neo4j.values.AnyValue import org.neo4j.values.virtual.MapValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/RelationshipCountFromCountStorePipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/RelationshipCountFromCountStorePipe.scala index 4281b896cb1d0..b17bc05741ae8 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/RelationshipCountFromCountStorePipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/RelationshipCountFromCountStorePipe.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.NameId -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.NameId +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.storable.Values case class RelationshipCountFromCountStorePipe(ident: String, startLabel: Option[LazyLabel], diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/RemoveLabelsPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/RemoveLabelsPipe.scala index b7be23d7169b8..408fd7ed0174e 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/RemoveLabelsPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/RemoveLabelsPipe.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.CastSupport import org.neo4j.cypher.internal.runtime.interpreted.GraphElementPropertyFunctions -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.storable.Values import org.neo4j.values.virtual.VirtualNodeValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/RollUpApplyPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/RollUpApplyPipe.scala index c65cf7903fd26..9f9edb16a402d 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/RollUpApplyPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/RollUpApplyPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.storable.Values.NO_VALUE import org.neo4j.values.virtual.VirtualValues diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SeekRhs.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SeekRhs.scala index edac87572a330..e934f35c244c8 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SeekRhs.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SeekRhs.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.v3_5.logical.plans.{ManyQueryExpression, QueryExpression, SingleQueryExpression} -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ object Seek { def unapply(v: Any) = v match { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SelectOrSemiApplyPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SelectOrSemiApplyPipe.scala index 367718f041706..d127e19db74f2 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SelectOrSemiApplyPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SelectOrSemiApplyPipe.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.Predicate -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class SelectOrSemiApplyPipe(source: Pipe, inner: Pipe, predicate: Predicate, negated: Boolean) (val id: Id = Id.INVALID_ID) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SemiApplyPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SemiApplyPipe.scala index fb274e5c875ef..39625a41728ed 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SemiApplyPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SemiApplyPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class SemiApplyPipe(source: Pipe, inner: Pipe, negated: Boolean) (val id: Id = Id.INVALID_ID) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SetOperation.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SetOperation.scala index 4d139aafeaff7..a0fbee3a746fb 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SetOperation.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SetOperation.scala @@ -24,7 +24,7 @@ import java.util.function.BiConsumer import org.neo4j.cypher.internal.runtime.interpreted._ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.{Operations, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.{CypherTypeException, InvalidArgumentException} +import org.opencypher.v9_0.util.{CypherTypeException, InvalidArgumentException} import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values import org.neo4j.values.virtual._ diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SetPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SetPipe.scala index 14d4c3de8efe4..094f409657672 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SetPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SetPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class SetPipe(src: Pipe, setOperation: SetOperation) (val id: Id = Id.INVALID_ID) extends PipeWithSource(src) { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ShortestPathPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ShortestPathPipe.scala index 5818d01f9145e..afb98a5969880 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ShortestPathPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ShortestPathPipe.scala @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.ShortestPath import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.ShortestPathExpression import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.Predicate -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.storable.Values import org.neo4j.values.virtual.{ListValue, PathValue, VirtualValues} diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SkipPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SkipPipe.scala index db91677f46031..4d46846dc1bd0 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SkipPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SkipPipe.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Expression, NumericHelper} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class SkipPipe(source: Pipe, exp: Expression) (val id: Id = Id.INVALID_ID) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SortPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SortPipe.scala index 8cd547693ba93..6e4f3a7ecf961 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SortPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SortPipe.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import java.util.Comparator import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.{AnyValue, AnyValues} case class SortPipe(source: Pipe, orderBy: Seq[ColumnOrder]) diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/TopPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/TopPipe.scala index 9c71ab29b7590..2b87d5092598d 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/TopPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/TopPipe.scala @@ -23,7 +23,7 @@ import java.util.Comparator import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.AnyValue import org.neo4j.values.storable.NumberValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/TriadicSelectionPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/TriadicSelectionPipe.scala index fb32b2233a182..bcdddc502a7a3 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/TriadicSelectionPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/TriadicSelectionPipe.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.eclipse.collections.impl.set.mutable.primitive.LongHashSet import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.CypherTypeException +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.storable.Values import org.neo4j.values.virtual.VirtualNodeValue diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UndirectedRelationshipByIdSeekPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UndirectedRelationshipByIdSeekPipe.scala index 599b2a301105e..b9fe7ae8caf9e 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UndirectedRelationshipByIdSeekPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UndirectedRelationshipByIdSeekPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.virtual.VirtualValues import scala.collection.JavaConverters._ diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UnionPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UnionPipe.scala index 102f6551c8ce0..3ef605e7dcf67 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UnionPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UnionPipe.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class UnionPipe(l: Pipe, r: Pipe) (val id: Id = Id.INVALID_ID) extends Pipe { diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UnwindPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UnwindPipe.scala index b232eaf3e6e57..081a02b95f614 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UnwindPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UnwindPipe.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.ListSupport -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.AnyValue import scala.annotation.tailrec diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ValueHashJoinPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ValueHashJoinPipe.scala index 89ec889d1415c..f614177e38a97 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ValueHashJoinPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ValueHashJoinPipe.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/VarLengthExpandPipe.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/VarLengthExpandPipe.scala index 449db02bbf5d6..0998db6b0bf7d 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/VarLengthExpandPipe.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/VarLengthExpandPipe.scala @@ -20,9 +20,9 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.values.storable.Values import org.neo4j.values.virtual._ diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/NumericExpressionOnly.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/NumericExpressionOnly.scala index a4446fbf51368..1cdb0def0073f 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/NumericExpressionOnly.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/NumericExpressionOnly.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.values.AnyValue import org.neo4j.values.storable.{NumberValue, Values} diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/PercentileFunction.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/PercentileFunction.scala index a398470884adf..1fca877b79cfb 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/PercentileFunction.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/PercentileFunction.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation -import org.neo4j.cypher.internal.util.v3_5.InvalidArgumentException +import org.opencypher.v9_0.util.InvalidArgumentException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Expression, NumericHelper} import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/MatchingContext.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/MatchingContext.scala index 204cc71236ef4..3cfef96d8f033 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/MatchingContext.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/MatchingContext.scala @@ -23,7 +23,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.Predicate import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState import org.neo4j.cypher.internal.runtime.interpreted.symbols.SymbolTable -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ import scala.collection.immutable diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/PatternGraph.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/PatternGraph.scala index 40c31ed8e9997..17a011030f249 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/PatternGraph.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/PatternGraph.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.pipes.matching -import org.neo4j.cypher.internal.util.v3_5.PatternException +import org.opencypher.v9_0.util.PatternException import org.neo4j.cypher.internal.runtime.interpreted.commands.Pattern case class PatternGraph(patternNodes: Map[String, PatternNode], diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/PatternMatchingBuilder.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/PatternMatchingBuilder.scala index 9a7a6823e9b85..fe43a3bd15e95 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/PatternMatchingBuilder.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/PatternMatchingBuilder.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes.matching import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.Predicate import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.values.AnyValue import org.neo4j.values.virtual.{NodeValue, RelationshipValue} diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/PatternNode.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/PatternNode.scala index 6791270052c04..9250ddce5374e 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/PatternNode.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/PatternNode.scala @@ -25,7 +25,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expres import org.neo4j.cypher.internal.runtime.interpreted.commands.values.{KeyToken, UnresolvedProperty} import org.neo4j.cypher.internal.runtime.interpreted.commands.{RelatedTo, SingleNode} import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.values.virtual.NodeValue import scala.collection.Map diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/PatternRelationship.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/PatternRelationship.scala index 64ce714e0a52e..61dd5c62cbd78 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/PatternRelationship.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/PatternRelationship.scala @@ -23,9 +23,9 @@ import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.commands.values.KeyToken import org.neo4j.cypher.internal.runtime.interpreted.pipes.{LazyTypes, QueryState} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection.{BOTH, INCOMING, OUTGOING} +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection.{BOTH, INCOMING, OUTGOING} import org.neo4j.graphdb.Path import org.neo4j.kernel.impl.util.ValueUtils import org.neo4j.values.virtual.{RelationshipValue, NodeValue} diff --git a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/symbols/SymbolTable.scala b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/symbols/SymbolTable.scala index e11367350f1ad..df4a76b065571 100644 --- a/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/symbols/SymbolTable.scala +++ b/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/symbols/SymbolTable.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.symbols -import org.neo4j.cypher.internal.util.v3_5.{CypherException, CypherTypeException, SyntaxException} -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.{CypherException, CypherTypeException, SyntaxException} +import org.opencypher.v9_0.util.symbols._ import scala.collection.Map diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/CSVResourcesTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/CSVResourcesTest.scala index 589f45a964972..d873249dfec4d 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/CSVResourcesTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/CSVResourcesTest.scala @@ -25,8 +25,8 @@ import org.apache.commons.lang3.SystemUtils import org.mockito.ArgumentMatchers._ import org.mockito.Mockito._ import org.neo4j.cypher.internal.runtime.CreateTempFileTestSupport -import org.neo4j.cypher.internal.util.v3_5.{LoadExternalResourceException, TaskCloser} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.{LoadExternalResourceException, TaskCloser} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.io.fs.FileUtils class CSVResourcesTest extends CypherFunSuite with CreateTempFileTestSupport { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/CastSupportTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/CastSupportTest.scala index a10d557416fca..d1ac2c075594e 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/CastSupportTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/CastSupportTest.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.runtime.interpreted -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.CypherTypeException +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.DurationValue.duration import org.neo4j.values.storable.LocalTimeValue.localTime import org.neo4j.values.storable._ diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/GraphElementPropertyFunctionsTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/GraphElementPropertyFunctionsTest.scala index 7fe3385e812a6..16a0e574ad20c 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/GraphElementPropertyFunctionsTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/GraphElementPropertyFunctionsTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.kernel.impl.util.ValueUtils import org.neo4j.values.storable.ArrayValue import org.neo4j.values.storable.Values._ diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/ImplicitDummyPos.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/ImplicitDummyPos.scala index 8fa563cebe804..d54bdc792977c 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/ImplicitDummyPos.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/ImplicitDummyPos.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted -import org.neo4j.cypher.internal.util.v3_5.{DummyPosition, InputPosition} +import org.opencypher.v9_0.util.{DummyPosition, InputPosition} import scala.language.implicitConversions trait ImplicitDummyPos { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/LastCommittedTxIdProviderTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/LastCommittedTxIdProviderTest.scala index 5d6ba5108f185..6c603c907663f 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/LastCommittedTxIdProviderTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/LastCommittedTxIdProviderTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted import org.neo4j.cypher.internal.javacompat.GraphDatabaseCypherService -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.GraphDatabaseService import org.neo4j.internal.kernel.api.Transaction import org.neo4j.kernel.NeoStoreDataSource diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/MakeValuesNeoSafeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/MakeValuesNeoSafeTest.scala index 54231d2196afc..785d79dca640f 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/MakeValuesNeoSafeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/MakeValuesNeoSafeTest.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.runtime.interpreted -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.CypherTypeException +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values._ import org.neo4j.values.virtual.VirtualValues.list diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/MatchingContextTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/MatchingContextTest.scala index 4928536151fd0..c87e86b28560c 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/MatchingContextTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/MatchingContextTest.scala @@ -28,8 +28,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.values.TokenType.P import org.neo4j.cypher.internal.runtime.interpreted.commands.{Pattern, RelatedTo, SingleNode, VarLengthRelatedTo} import org.neo4j.cypher.internal.runtime.interpreted.pipes.matching.MatchingContext import org.neo4j.cypher.internal.runtime.interpreted.symbols.SymbolTable -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.values.AnyValue import scala.collection.Map diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/QueryContextAdaptation.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/QueryContextAdaptation.scala index 7f3b30407e44d..458a950996cb7 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/QueryContextAdaptation.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/QueryContextAdaptation.scala @@ -24,7 +24,7 @@ import java.net.URL import org.eclipse.collections.api.iterator.LongIterator import org.neo4j.cypher.internal.planner.v3_5.spi.{IdempotentResult, IndexDescriptor} import org.neo4j.cypher.internal.runtime._ -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.cypher.internal.v3_5.logical.plans.QualifiedName import org.neo4j.graphdb.{Node, Path, PropertyContainer} import org.neo4j.internal.kernel.api.helpers.RelationshipSelectionCursor diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/ResourceManagerTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/ResourceManagerTest.scala index 3f5efc774e212..9baa364fa0df2 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/ResourceManagerTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/ResourceManagerTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted import org.mockito.Mockito.{verify, verifyNoMoreInteractions, when} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import scala.util.Try diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/SeekRangeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/SeekRangeTest.scala index 9ce5462481b38..f54bc101296c1 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/SeekRangeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/SeekRangeTest.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.runtime.interpreted -import org.neo4j.cypher.internal.util.v3_5.NonEmptyList -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.NonEmptyList +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.v3_5.logical.plans._ import org.neo4j.values.storable.{Value, Values} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/TransactionBoundPlanContextTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/TransactionBoundPlanContextTest.scala index e49984ff4826d..0c2ec7c8e9ba0 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/TransactionBoundPlanContextTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/TransactionBoundPlanContextTest.scala @@ -21,11 +21,11 @@ package org.neo4j.cypher.internal.runtime.interpreted import java.util.concurrent.TimeUnit.SECONDS -import org.neo4j.cypher.internal.frontend.v3_5.phases.devNullLogger +import org.opencypher.v9_0.frontend.phases.devNullLogger import org.neo4j.cypher.internal.javacompat.GraphDatabaseCypherService import org.neo4j.cypher.internal.planner.v3_5.spi.IndexDescriptor -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, LabelId, RelTypeId} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.{Cardinality, LabelId, RelTypeId} import org.neo4j.graphdb.{GraphDatabaseService, Label, RelationshipType} import org.neo4j.internal.kernel.api.Transaction.Type._ import org.neo4j.internal.kernel.api.security.LoginContext.AUTH_DISABLED diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/TransactionBoundQueryContextTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/TransactionBoundQueryContextTest.scala index 07c962b87de1a..a81697280d3e7 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/TransactionBoundQueryContextTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/TransactionBoundQueryContextTest.scala @@ -27,8 +27,8 @@ import org.mockito.Mockito._ import org.neo4j.cypher.internal.javacompat import org.neo4j.cypher.internal.javacompat.GraphDatabaseCypherService import org.neo4j.cypher.internal.runtime.interpreted.TransactionBoundQueryContext.IndexSearchMonitor -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.graphdb._ import org.neo4j.graphdb.config.Setting import org.neo4j.graphdb.factory.GraphDatabaseSettings diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/UpdateCountingQueryContextTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/UpdateCountingQueryContextTest.scala index 020ac7fb3128f..4abcbb96cd3a2 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/UpdateCountingQueryContextTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/UpdateCountingQueryContextTest.scala @@ -25,7 +25,7 @@ import org.mockito.invocation.InvocationOnMock import org.mockito.stubbing.Answer import org.neo4j.cypher.internal.planner.v3_5.spi.{IdempotentResult, IndexDescriptor} import org.neo4j.cypher.internal.runtime.{Operations, QueryContext, QueryStatistics} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.{Node, Relationship} import org.neo4j.internal.kernel.api.IndexReference import org.neo4j.values.storable.Values diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/AddTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/AddTest.scala index 2544d25cb93ab..eee685ec50e82 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/AddTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/AddTest.scala @@ -23,8 +23,8 @@ import java.nio.charset.StandardCharsets import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Add, Literal, ParameterExpression} -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.CypherTypeException +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values.{longValue, stringValue, utf8Value} import org.neo4j.values.storable.{UTF8StringValue, Values} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/AllVariablesTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/AllVariablesTest.scala index 31b838a42e36b..fc6a1b4055d81 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/AllVariablesTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/AllVariablesTest.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Variable import org.neo4j.cypher.internal.runtime.interpreted.symbols.SymbolTable -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class AllVariablesTest extends CypherFunSuite { val x = AllVariables() diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/AndsTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/AndsTest.scala index 86fc8c585821f..7208d48ef3b06 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/AndsTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/AndsTest.scala @@ -21,11 +21,11 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands import org.mockito.ArgumentMatchers._ import org.mockito.Mockito._ -import org.neo4j.cypher.internal.util.v3_5.NonEmptyList +import org.opencypher.v9_0.util.NonEmptyList import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.{Ands, Not, Predicate, True} import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class AndsTest extends CypherFunSuite { private val state = QueryStateHelper.empty diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/CoalesceTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/CoalesceTest.scala index 0c997926794e8..4999f81d8c471 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/CoalesceTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/CoalesceTest.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{CoalesceFunction, Expression, Literal, Null} import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values import org.neo4j.values.storable.Values.stringValue diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/CoercedPredicateTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/CoercedPredicateTest.scala index 4d668d337c2c2..aa0b705e7cc98 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/CoercedPredicateTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/CoercedPredicateTest.scala @@ -23,7 +23,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{ListL import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.{CoercedPredicate, Not, True} import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class CoercedPredicateTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/ComparablePredicateTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/ComparablePredicateTest.scala index b808d8543e919..40d998984277d 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/ComparablePredicateTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/ComparablePredicateTest.scala @@ -23,7 +23,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Literal import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates._ import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.AnyValues import org.neo4j.values.storable.Values import org.scalatest.matchers.{MatchResult, Matcher} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/ExtractTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/ExtractTest.scala index dbf832bc77ff3..cdfcddfee62b1 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/ExtractTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/ExtractTest.scala @@ -23,7 +23,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.ImplicitValueConversion._ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{ExtractFunction, SizeFunction, Variable} import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.intValue import org.neo4j.values.virtual.VirtualValues.list diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/HasLabelTests.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/HasLabelTests.scala index ac00087cded9a..a3fe3359d614b 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/HasLabelTests.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/HasLabelTests.scala @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Litera import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.HasLabel import org.neo4j.cypher.internal.runtime.interpreted.commands.values.{KeyToken, TokenType} import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class HasLabelTests extends CypherFunSuite { test("should_handle_null_values") { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/LengthFunctionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/LengthFunctionTest.scala index 41a34857dcdf8..ff847f38a88b9 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/LengthFunctionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/LengthFunctionTest.scala @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.runtime.ImplicitValueConversion._ import org.neo4j.cypher.internal.runtime.PathImpl import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{LengthFunction, Variable} import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.{Node, Relationship} import org.neo4j.kernel.impl.util.ValueUtils import org.neo4j.values.storable.Values.intValue diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/ListLiteralTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/ListLiteralTest.scala index d35840aca41ff..afcf24eafe02a 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/ListLiteralTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/ListLiteralTest.scala @@ -23,7 +23,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Expression, Literal, Variable} import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.{CoercedPredicate, Predicate} import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.{FALSE, NO_VALUE, TRUE} class ListLiteralTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/MathFunctionsTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/MathFunctionsTest.scala index 41bece85765a1..d2e881c8d2f39 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/MathFunctionsTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/MathFunctionsTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions._ import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.LongValue import org.neo4j.values.storable.Values.{doubleValue, longValue} class MathFunctionsTest extends CypherFunSuite with NumericHelper { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/OrsTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/OrsTest.scala index be4b30da6dd8f..2df7ce59f6c27 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/OrsTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/OrsTest.scala @@ -21,11 +21,11 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands import org.mockito.ArgumentMatchers._ import org.mockito.Mockito._ -import org.neo4j.cypher.internal.util.v3_5.NonEmptyList +import org.opencypher.v9_0.util.NonEmptyList import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.{Not, Ors, Predicate, True} import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class OrsTest extends CypherFunSuite { private val state = QueryStateHelper.empty diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/PatternComprehensionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/PatternComprehensionTest.scala index 7df6c4c884ec1..e10f25694bf4b 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/PatternComprehensionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/PatternComprehensionTest.scala @@ -23,8 +23,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Variable import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.True import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.values.storable.Values.NO_VALUE class PatternComprehensionTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/PropertyValueComparisonTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/PropertyValueComparisonTest.scala index 7365b870cb4d1..cf549d50f1e05 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/PropertyValueComparisonTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/PropertyValueComparisonTest.scala @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.runtime.ImplicitValueConversion._ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Property, Variable} import org.neo4j.cypher.internal.runtime.interpreted.commands.values.TokenType.PropertyKey import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.NO_VALUE class PropertyValueComparisonTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/ReduceTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/ReduceTest.scala index 66cf5e64fc30c..0cb96cc752220 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/ReduceTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/ReduceTest.scala @@ -23,7 +23,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.ImplicitValueConversion._ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions._ import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values import org.neo4j.values.storable.Values.longValue diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/RegularExpressionPredicateTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/RegularExpressionPredicateTest.scala index 63232690c18ea..71dce5b96f5d6 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/RegularExpressionPredicateTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/RegularExpressionPredicateTest.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Literal, Null} import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.{LiteralRegularExpression, RegularExpression} import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class RegularExpressionPredicateTest extends CypherFunSuite { test("LiteralRegEx: should not match if the lhs expression evaluates to null") { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/SizeFunctionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/SizeFunctionTest.scala index 1c5208f5e71ea..7382619e1a3c7 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/SizeFunctionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/SizeFunctionTest.scala @@ -19,13 +19,13 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.ImplicitValueConversion._ import org.neo4j.cypher.internal.runtime.PathImpl import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{SizeFunction, Variable} import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.{Node, Relationship} import org.neo4j.values.storable.Values.longValue diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/SplittingPredicateTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/SplittingPredicateTest.scala index cfa5a4e4acdf1..e8ed308ce0a97 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/SplittingPredicateTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/SplittingPredicateTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Literal import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class SplittingPredicateTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/SubtractTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/SubtractTest.scala index 7d093a9edbf57..7c874c47d690b 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/SubtractTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/SubtractTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Literal, Subtract} import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.longValue class SubtractTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/convert/PathExpressionConversionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/convert/PathExpressionConversionTest.scala index 32ea0e2d47068..f9f940f057eaf 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/convert/PathExpressionConversionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/convert/PathExpressionConversionTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.convert -import org.neo4j.cypher.internal.util.v3_5.{DummyPosition, InputPosition} +import org.opencypher.v9_0.util.{DummyPosition, InputPosition} import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.ProjectedPath import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.ProjectedPath._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ class PathExpressionConversionTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/CoerceToTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/CoerceToTest.scala index 230da7245d360..00ea01ffc5b6d 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/CoerceToTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/CoerceToTest.scala @@ -22,11 +22,11 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import java.util.{ArrayList => JavaList, HashMap => JavaMap} import org.neo4j.cypher.internal.runtime.{Counter, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.AnyValue import org.neo4j.values.storable.PointValue import org.neo4j.values.storable.Values._ diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ContainerIndexTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ContainerIndexTest.scala index d7667c8372ca8..0cc872d8b0522 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ContainerIndexTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ContainerIndexTest.scala @@ -24,8 +24,8 @@ import org.mockito.invocation.InvocationOnMock import org.mockito.stubbing.Answer import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} import org.neo4j.cypher.internal.runtime.{Operations, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.util.v3_5.{CypherTypeException, InvalidArgumentException} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.{CypherTypeException, InvalidArgumentException} import org.neo4j.graphdb.{Node, Relationship} import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values.longValue diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/DistanceFunctionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/DistanceFunctionTest.scala index a3aa86dce86b4..604a077292a62 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/DistanceFunctionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/DistanceFunctionTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.CRSCalculator.GeographicCalculator.EARTH_RADIUS_METERS import org.neo4j.values.storable.{CoordinateReferenceSystem, PointValue, Values} import org.scalactic.{Equality, TolerantNumerics} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/DivideTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/DivideTest.scala index 210d4593624b2..56b0010fe9d7f 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/DivideTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/DivideTest.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} -import org.neo4j.cypher.internal.util.v3_5.ArithmeticException -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.ArithmeticException +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.{NumberValue} class DivideTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ExpressionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ExpressionTest.scala index 31ce99ba47d1c..ccb20ac5d2c4d 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ExpressionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ExpressionTest.scala @@ -24,8 +24,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.ReturnItem import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.{CoercedPredicate, Not, True} import org.neo4j.cypher.internal.runtime.interpreted.commands.values.TokenType.PropertyKey import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import scala.collection.Map diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/GenericCaseTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/GenericCaseTest.scala index d77ddf9ea5d97..2d5cad29020e7 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/GenericCaseTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/GenericCaseTest.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.{CoercedPredicate, Equals, Predicate} import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.{NO_VALUE, stringValue} class GenericCaseTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/IndexedInclusiveLongRangeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/IndexedInclusiveLongRangeTest.scala index 6483c246adcef..ab568ceac6c3f 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/IndexedInclusiveLongRangeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/IndexedInclusiveLongRangeTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import scala.util.Random diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/KeysFunctionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/KeysFunctionTest.scala index b14f5b7902871..d537558085dc1 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/KeysFunctionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/KeysFunctionTest.scala @@ -23,7 +23,7 @@ import org.mockito.Mockito._ import org.neo4j.cypher.internal.runtime.ImplicitValueConversion._ import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} import org.neo4j.cypher.internal.runtime.{Operations, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.Node import org.neo4j.values.storable.Values.stringValue import org.neo4j.values.virtual.NodeValue diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/LabelsFunctionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/LabelsFunctionTest.scala index 17338b8c1efd3..e04e9b4323f9d 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/LabelsFunctionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/LabelsFunctionTest.scala @@ -23,7 +23,7 @@ import org.mockito.Mockito._ import org.neo4j.cypher.internal.runtime.ImplicitValueConversion._ import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.Node import org.neo4j.values.storable.Values.stringValue import org.neo4j.values.virtual.VirtualValues.list diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ListSliceTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ListSliceTest.scala index 545de2e0cd36e..a2aea6d521bae 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ListSliceTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ListSliceTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values import org.neo4j.values.storable.Values.longValue import org.neo4j.values.virtual.VirtualValues.{EMPTY_LIST, list} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/LiteralMapTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/LiteralMapTest.scala index 531876f2f966b..61e97096c3e02 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/LiteralMapTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/LiteralMapTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.commands.values.UnresolvedProperty -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class LiteralMapTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ModuloTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ModuloTest.scala index 6b35e20fccea7..e3b5dae19111e 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ModuloTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ModuloTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.ImplicitValueConversion._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.{doubleValue, longValue} class ModuloTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PathImplTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PathImplTest.scala index 1930e6c9ff89c..dfdff7af6858a 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PathImplTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PathImplTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.PathImpl -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb._ import scala.collection.JavaConverters._ diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PathValueBuilderTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PathValueBuilderTest.scala index 68b70045a2123..b0210781371db 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PathValueBuilderTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PathValueBuilderTest.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.mockito.Mockito import org.neo4j.cypher.internal.runtime.ImplicitValueConversion._ import org.neo4j.cypher.internal.runtime.PathImpl -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.{Node, Relationship, RelationshipType} import org.neo4j.kernel.impl.util.ValueUtils.fromPath import org.neo4j.values.storable.Values.NO_VALUE diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PropertiesFunctionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PropertiesFunctionTest.scala index 0a7c1093ce496..ee2df50f4f460 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PropertiesFunctionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/PropertiesFunctionTest.scala @@ -26,8 +26,8 @@ import org.mockito.invocation.InvocationOnMock import org.mockito.stubbing.Answer import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} import org.neo4j.cypher.internal.runtime.{Operations, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.CypherTypeException +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.{Node, Relationship} import org.neo4j.values.storable.Values.{NO_VALUE, stringValue} import org.neo4j.values.virtual.VirtualValues.map diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/RangeFunctionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/RangeFunctionTest.scala index d7290ca939eb1..2c87b40bef718 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/RangeFunctionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/RangeFunctionTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values import org.neo4j.values.virtual.ListValue import org.neo4j.values.virtual.VirtualValues.list diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/RelationshipTypeFunctionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/RelationshipTypeFunctionTest.scala index 8d8fd466c7c09..374590f39f398 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/RelationshipTypeFunctionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/RelationshipTypeFunctionTest.scala @@ -21,11 +21,11 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.mockito.ArgumentMatchers.any import org.mockito.Mockito._ -import org.neo4j.cypher.internal.util.v3_5.ParameterWrongTypeException +import org.opencypher.v9_0.util.ParameterWrongTypeException import org.neo4j.cypher.internal.runtime.ImplicitValueConversion._ import org.neo4j.cypher.internal.runtime.{Operations, QueryContext} import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.{Relationship, RelationshipType} import org.neo4j.values.storable.Values.stringValue diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ShortestPathNoDuplicatesTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ShortestPathNoDuplicatesTest.scala index b24ec0d5fac84..37d69fa6efc12 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ShortestPathNoDuplicatesTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ShortestPathNoDuplicatesTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.Relationship import org.neo4j.kernel.impl.core.EmbeddedProxySPI import org.neo4j.kernel.impl.core.RelationshipProxy diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/SimpleCaseTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/SimpleCaseTest.scala index f082db85c1705..baccca15135c3 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/SimpleCaseTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/SimpleCaseTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.{NO_VALUE, stringValue} class SimpleCaseTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/SplitFunctionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/SplitFunctionTest.scala index 19a18fb6fdaab..c7e8149f7b269 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/SplitFunctionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/SplitFunctionTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values._ import org.neo4j.values.virtual.VirtualValues.list diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/StringFunctionsTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/StringFunctionsTest.scala index 90a7089896229..1b76ebb73173d 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/StringFunctionsTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/StringFunctionsTest.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.CypherTypeException +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values import org.neo4j.values.storable.Values.{EMPTY_STRING, stringArray, stringValue} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToBooleanFunctionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToBooleanFunctionTest.scala index 872ffa10c7edd..d91aa1d198332 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToBooleanFunctionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToBooleanFunctionTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.ParameterWrongTypeException +import org.opencypher.v9_0.util.ParameterWrongTypeException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values._ class ToBooleanFunctionTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToFloatFunctionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToFloatFunctionTest.scala index dc6a76c53df56..a14aa96baaf34 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToFloatFunctionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToFloatFunctionTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.ParameterWrongTypeException +import org.opencypher.v9_0.util.ParameterWrongTypeException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.{NO_VALUE, doubleValue} class ToFloatFunctionTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToIntegerFunctionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToIntegerFunctionTest.scala index 7aa6721357f22..836b8ade7e020 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToIntegerFunctionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToIntegerFunctionTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.{CypherTypeException, ParameterWrongTypeException} +import org.opencypher.v9_0.util.{CypherTypeException, ParameterWrongTypeException} import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.{NO_VALUE, longValue} class ToIntegerFunctionTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToStringFunctionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToStringFunctionTest.scala index 413215ca52c3a..949e64c43fd66 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToStringFunctionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/ToStringFunctionTest.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions -import org.neo4j.cypher.internal.util.v3_5.ParameterWrongTypeException +import org.opencypher.v9_0.util.ParameterWrongTypeException import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.{NO_VALUE, stringValue} class ToStringFunctionTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/TypeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/TypeTest.scala index 717382d90bae4..f0cb4988ffcfc 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/TypeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/expressions/TypeTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.{DoubleValue, LongValue} class TypeTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/groupInequalityPredicatesForLegacyTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/groupInequalityPredicatesForLegacyTest.scala index d6f9e8f59911a..e8a44305ec7e2 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/groupInequalityPredicatesForLegacyTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/groupInequalityPredicatesForLegacyTest.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.commands -import org.neo4j.cypher.internal.util.v3_5.NonEmptyList +import org.opencypher.v9_0.util.NonEmptyList import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Expression, Literal, Property, Variable} import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates._ import org.neo4j.cypher.internal.runtime.interpreted.commands.values.TokenType.PropertyKey -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class GroupInequalityPredicatesForLegacyTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/CheckerTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/CheckerTest.scala index d3e41e2453b8b..94b9ca3005efe 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/CheckerTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/CheckerTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.predicates import org.neo4j.cypher.internal.runtime.interpreted.ValueConversion -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values import org.neo4j.values.storable.Values.{NO_VALUE, intValue, stringValue} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/ConstantCachedInTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/ConstantCachedInTest.scala index aa54c26f82ba1..db84d5ade0874 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/ConstantCachedInTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/predicates/ConstantCachedInTest.scala @@ -23,7 +23,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.ImplicitValueConversion._ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Expression, ListLiteral, Literal, Variable} import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values._ import org.neo4j.values.virtual.VirtualValues diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/values/KeyTokenTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/values/KeyTokenTest.scala index 25ecd0c218826..ea3ed8ad25108 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/values/KeyTokenTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/commands/values/KeyTokenTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.commands.values import org.neo4j.cypher.internal.planner.v3_5.spi.TokenContext import org.neo4j.cypher.internal.runtime.QueryContext -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class KeyTokenTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/AllNodesScanPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/AllNodesScanPipeTest.scala index 681b8d07b3a6d..b901fa2bea253 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/AllNodesScanPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/AllNodesScanPipeTest.scala @@ -23,7 +23,7 @@ import org.mockito.Mockito import org.neo4j.cypher.internal.runtime.interpreted.ValueComparisonHelper._ import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} import org.neo4j.cypher.internal.runtime.{Operations, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.virtual.NodeValue class AllNodesScanPipeTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/AllShortestPathsPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/AllShortestPathsPipeTest.scala index 4de027b72b197..cdcd179e4a41c 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/AllShortestPathsPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/AllShortestPathsPipeTest.scala @@ -23,8 +23,8 @@ import org.neo4j.cypher.GraphDatabaseFunSuite import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper.withQueryState import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.ShortestPathExpression import org.neo4j.cypher.internal.runtime.interpreted.commands.{ShortestPath, SingleNode} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.graphdb.Node import org.neo4j.kernel.impl.util.ValueUtils.fromNodeProxy import org.neo4j.values.virtual.PathValue diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ApplyPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ApplyPipeTest.scala index 8c3225e74feee..536d7cd534db8 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ApplyPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ApplyPipeTest.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ValueComparisonHelper._ import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} -import org.neo4j.cypher.internal.util.v3_5.symbols.CTNumber -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols.CTNumber +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values class ApplyPipeTest extends CypherFunSuite with PipeTestSupport { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DirectedDirectedRelationshipByIdSeekPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DirectedDirectedRelationshipByIdSeekPipeTest.scala index 02512b0a37809..8f6a7823af44c 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DirectedDirectedRelationshipByIdSeekPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DirectedDirectedRelationshipByIdSeekPipeTest.scala @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.ValueComparisonHelper._ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{ListLiteral, Literal} import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} import org.neo4j.cypher.internal.runtime.{Operations, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.virtual.{RelationshipValue, NodeValue} class DirectedDirectedRelationshipByIdSeekPipeTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DistinctPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DistinctPipeTest.scala index 54d45addcdd1c..bd6b9755a9843 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DistinctPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/DistinctPipeTest.scala @@ -22,8 +22,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper import org.neo4j.cypher.internal.runtime.interpreted.ValueComparisonHelper._ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Expression, Literal, Multiply, Variable} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.stringArray import org.neo4j.values.virtual.MapValue diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/EagerAggregationPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/EagerAggregationPipeTest.scala index ebb96489b22ac..f2079faddc96c 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/EagerAggregationPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/EagerAggregationPipeTest.scala @@ -22,8 +22,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions._ import org.neo4j.cypher.internal.runtime.interpreted.commands.values.TokenType.PropertyKey -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values import org.neo4j.values.storable.Values.{intValue, longValue, stringValue} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/EagerPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/EagerPipeTest.scala index 3917ebd7d7036..8badea97fa95e 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/EagerPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/EagerPipeTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.{QueryContext, QueryTransactionalContext} import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryContextAdaptation, QueryStateHelper} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class EagerPipeTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ErrorPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ErrorPipeTest.scala index 8c91c76eb555b..cafa22c21ad14 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ErrorPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ErrorPipeTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class ErrorPipeTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ExpandAllPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ExpandAllPipeTest.scala index 891b81c40d81e..a3a9319fa4f14 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ExpandAllPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ExpandAllPipeTest.scala @@ -25,8 +25,8 @@ import org.mockito.invocation.InvocationOnMock import org.mockito.stubbing.Answer import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.graphdb.{Node, Relationship} import org.neo4j.kernel.impl.util.ValueUtils import org.neo4j.kernel.impl.util.ValueUtils.{fromNodeProxy, fromRelationshipProxy} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ExpandIntoPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ExpandIntoPipeTest.scala index bc9ca5f7ee9b1..cd8072e279282 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ExpandIntoPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ExpandIntoPipeTest.scala @@ -24,9 +24,9 @@ import org.mockito.Mockito._ import org.mockito.invocation.InvocationOnMock import org.mockito.stubbing.Answer import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.graphdb.{Node, Relationship} import org.neo4j.kernel.impl.util.ValueUtils.{fromNodeProxy, fromRelationshipProxy} import org.neo4j.values.virtual.RelationshipValue diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/FakePipe.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/FakePipe.scala index 3ca32eace388c..713825fa8c0e9 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/FakePipe.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/FakePipe.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.symbols.CypherType +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.symbols.CypherType import org.neo4j.kernel.impl.util.ValueUtils import org.scalatest.mock.MockitoSugar diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyGroupingIteratorTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyGroupingIteratorTest.scala index 959bcfee27c63..bbb5cd2fd97c7 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyGroupingIteratorTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyGroupingIteratorTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.eclipse.collections.api.LongIterable import org.eclipse.collections.impl.set.mutable.primitive.LongHashSet -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class LazyGroupingIteratorTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyPropertyKeyTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyPropertyKeyTest.scala index 6f3fe37935399..882e7ca3ed860 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyPropertyKeyTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyPropertyKeyTest.scala @@ -20,11 +20,11 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.mockito.Mockito._ -import org.neo4j.cypher.internal.util.v3_5.{DummyPosition, PropertyKeyId} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.util.{DummyPosition, PropertyKeyId} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.planner.v3_5.spi.TokenContext -import org.neo4j.cypher.internal.v3_5.expressions.PropertyKeyName +import org.opencypher.v9_0.expressions.PropertyKeyName import scala.collection.mutable diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyTypesTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyTypesTest.scala index e923f68c43fd8..9e6fba3707ef2 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyTypesTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LazyTypesTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.mockito.Mockito._ import org.neo4j.cypher.internal.runtime.QueryContext -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class LazyTypesTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LegacyPruningVarLengthExpandPipe.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LegacyPruningVarLengthExpandPipe.scala index 2b47dfd242ba7..fabf092021400 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LegacyPruningVarLengthExpandPipe.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LegacyPruningVarLengthExpandPipe.scala @@ -21,9 +21,9 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.eclipse.collections.impl.map.mutable.primitive.LongObjectHashMap import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.values.storable.{Value, Values} import org.neo4j.values.virtual.{NodeReference, NodeValue, RelationshipValue} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LetSelectOrSemiApplyPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LetSelectOrSemiApplyPipeTest.scala index 66731a3be51d9..abf36e7612d11 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LetSelectOrSemiApplyPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LetSelectOrSemiApplyPipeTest.scala @@ -22,8 +22,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Literal, Variable} import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.{Equals, Not, True} -import org.neo4j.cypher.internal.util.v3_5.symbols.CTNumber -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols.CTNumber +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.{FALSE, TRUE, intValue} class LetSelectOrSemiApplyPipeTest extends CypherFunSuite with PipeTestSupport { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LetSemiApplyPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LetSemiApplyPipeTest.scala index 553f7e9525838..60fb7b8b048d0 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LetSemiApplyPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LetSemiApplyPipeTest.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.symbols.CTNumber -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols.CTNumber +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.{FALSE, TRUE, intValue} class LetSemiApplyPipeTest extends CypherFunSuite with PipeTestSupport { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LimitPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LimitPipeTest.scala index 94ceacc78b8d8..ecba9cbab6f98 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LimitPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/LimitPipeTest.scala @@ -23,8 +23,8 @@ import org.mockito.Mockito._ import org.mockito.internal.stubbing.defaultanswers.ReturnsMocks import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Literal -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class LimitPipeTest extends CypherFunSuite { test("limit 0 should not pull anything from the incoming iterator") { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeByIdSeekPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeByIdSeekPipeTest.scala index 8adc372cc0c28..c04c61fedef7c 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeByIdSeekPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeByIdSeekPipeTest.scala @@ -25,7 +25,7 @@ import org.mockito.{ArgumentMatchers, Mockito} import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{ListLiteral, Literal} import org.neo4j.cypher.internal.runtime.{Operations, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.Node import org.neo4j.kernel.impl.util.ValueUtils.fromNodeProxy import org.neo4j.values.virtual.NodeValue diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeByLabelScanPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeByLabelScanPipeTest.scala index 7b6949c8edad4..c135b2f7c4ae5 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeByLabelScanPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeByLabelScanPipeTest.scala @@ -19,12 +19,12 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.pipes -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.LabelId -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.LabelName +import org.opencypher.v9_0.util.LabelId +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.LabelName import org.neo4j.values.storable.Values import org.neo4j.values.virtual.VirtualValues diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeCountFromCountStorePipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeCountFromCountStorePipeTest.scala index 7b27557e454a0..6b86e3066caf0 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeCountFromCountStorePipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeCountFromCountStorePipeTest.scala @@ -20,12 +20,12 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.mockito.Mockito._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.{ImplicitDummyPos, QueryStateHelper} -import org.neo4j.cypher.internal.util.v3_5.{InputPosition, LabelId, NameId} -import org.neo4j.cypher.internal.v3_5.expressions.LabelName +import org.opencypher.v9_0.util.{InputPosition, LabelId, NameId} +import org.opencypher.v9_0.expressions.LabelName import org.neo4j.values.storable.Values.longValue class NodeCountFromCountStorePipeTest extends CypherFunSuite with ImplicitDummyPos { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeHashJoinPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeHashJoinPipeTest.scala index 5bba854e354d4..a24a590d3b0a0 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeHashJoinPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeHashJoinPipeTest.scala @@ -25,8 +25,8 @@ import org.mockito.stubbing.Answer import org.neo4j.cypher.internal.runtime.ImplicitValueConversion._ import org.neo4j.cypher.internal.runtime.interpreted.symbols.SymbolTable import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper, TestableIterator} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.Node import org.neo4j.kernel.impl.util.ValueUtils.fromNodeProxy import org.neo4j.values.AnyValue diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexScanPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexScanPipeTest.scala index 38b32d303021d..fbeb44963c59a 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexScanPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexScanPipeTest.scala @@ -24,9 +24,9 @@ import org.mockito.Mockito._ import org.neo4j.cypher.internal.planner.v3_5.spi.IndexDescriptor import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.{ImplicitDummyPos, QueryStateHelper} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.util.v3_5.{LabelId, PropertyKeyId} -import org.neo4j.cypher.internal.v3_5.expressions.{LabelName, LabelToken, PropertyKeyName, PropertyKeyToken} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.{LabelId, PropertyKeyId} +import org.opencypher.v9_0.expressions.{LabelName, LabelToken, PropertyKeyName, PropertyKeyToken} import org.neo4j.values.virtual.NodeValue class NodeIndexScanPipeTest extends CypherFunSuite with ImplicitDummyPos { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexSeekPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexSeekPipeTest.scala index 65214a672f055..6f15ccca303b2 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexSeekPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeIndexSeekPipeTest.scala @@ -26,9 +26,9 @@ import org.neo4j.cypher.internal.planner.v3_5.spi.IndexDescriptor import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{ListLiteral, Literal, Variable} import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, ImplicitDummyPos, QueryStateHelper} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.{CypherFunSuite, WindowsStringSafe} -import org.neo4j.cypher.internal.util.v3_5.{CypherTypeException, LabelId, PropertyKeyId} -import org.neo4j.cypher.internal.v3_5.expressions.{LabelName, LabelToken, PropertyKeyName, PropertyKeyToken} +import org.opencypher.v9_0.util.test_helpers.{CypherFunSuite, WindowsStringSafe} +import org.opencypher.v9_0.util.{CypherTypeException, LabelId, PropertyKeyId} +import org.opencypher.v9_0.expressions.{LabelName, LabelToken, PropertyKeyName, PropertyKeyToken} import org.neo4j.cypher.internal.v3_5.logical.plans.{CompositeQueryExpression, ManyQueryExpression, SingleQueryExpression} import org.neo4j.internal.kernel.api.{IndexQuery, IndexReference} import org.neo4j.values.storable.Values.stringValue diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeLeftOuterHashJoinPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeLeftOuterHashJoinPipeTest.scala index a023cfa840128..88b3358928390 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeLeftOuterHashJoinPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeLeftOuterHashJoinPipeTest.scala @@ -23,7 +23,7 @@ import org.mockito.ArgumentMatchers._ import org.mockito.Mockito._ import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper, TestableIterator} import org.neo4j.cypher.internal.runtime.ImplicitValueConversion._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.Node import org.neo4j.kernel.impl.util.ValueUtils.fromNodeProxy import org.neo4j.values.AnyValue diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeRightOuterHashJoinPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeRightOuterHashJoinPipeTest.scala index 65b3944b96284..b8ef79a8ed3d4 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeRightOuterHashJoinPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/NodeRightOuterHashJoinPipeTest.scala @@ -23,7 +23,7 @@ import org.mockito.ArgumentMatchers._ import org.mockito.Mockito._ import org.neo4j.cypher.internal.runtime.ImplicitValueConversion._ import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper, TestableIterator} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.Node import org.neo4j.kernel.impl.util.ValueUtils.fromNodeProxy import org.neo4j.values.AnyValue diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalExpandAllPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalExpandAllPipeTest.scala index 67782a05a4242..d59b32104d5a5 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalExpandAllPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalExpandAllPipeTest.scala @@ -27,8 +27,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QuerySta import org.neo4j.cypher.internal.runtime.ImplicitValueConversion._ import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.{Not, Predicate, True} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.graphdb.{Node, Relationship} import org.neo4j.kernel.impl.util.ValueUtils import org.neo4j.kernel.impl.util.ValueUtils.{fromNodeProxy, fromRelationshipProxy} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalExpandIntoPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalExpandIntoPipeTest.scala index 7c2f6af9d2fcc..773c6aae94e04 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalExpandIntoPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalExpandIntoPipeTest.scala @@ -27,8 +27,8 @@ import org.neo4j.cypher.internal.runtime.ImplicitValueConversion._ import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.{Not, Predicate, True} import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.graphdb.{Node, Relationship} import org.neo4j.kernel.impl.util.ValueUtils import org.neo4j.kernel.impl.util.ValueUtils.{fromNodeProxy, fromRelationshipProxy} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalPipeTest.scala index 54abfd19b06f1..90468d960b3c0 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OptionalPipeTest.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.symbols.CTNumber -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols.CTNumber +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.{NO_VALUE, intValue} class OptionalPipeTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/PipeTestSupport.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/PipeTestSupport.scala index bac8c9aff124c..8fdefbf86ced1 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/PipeTestSupport.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/PipeTestSupport.scala @@ -25,9 +25,9 @@ import org.mockito.invocation.InvocationOnMock import org.mockito.stubbing.Answer import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.symbols.{CypherType, _} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherTestSupport +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.symbols.{CypherType, _} +import org.opencypher.v9_0.util.test_helpers.CypherTestSupport import org.neo4j.graphdb.{Node, Relationship} import org.neo4j.kernel.impl.util.ValueUtils import org.scalatest.mock.MockitoSugar diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProcedureCallPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProcedureCallPipeTest.scala index 6ff55cdf910f9..5c4b7d8d845e6 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProcedureCallPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProcedureCallPipeTest.scala @@ -23,8 +23,8 @@ import org.neo4j.cypher.internal.runtime.ImplicitValueConversion._ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Variable import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, ImplicitDummyPos, QueryContextAdaptation, QueryStateHelper} import org.neo4j.cypher.internal.runtime.{EagerReadWriteCallMode, LazyReadOnlyCallMode, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.v3_5.logical.plans._ import org.neo4j.values.AnyValue import org.neo4j.values.storable.{IntValue, LongValue} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProduceResultsPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProduceResultsPipeTest.scala index b24a47a0bff8a..0800413abe2af 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProduceResultsPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProduceResultsPipeTest.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.mockito.Mockito._ import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.ImplicitValueConversion._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.{FALSE, TRUE, intValue, stringValue} class ProduceResultsPipeTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProjectEndpointsPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProjectEndpointsPipeTest.scala index 88b8dc8523555..ebdb61529f286 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProjectEndpointsPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ProjectEndpointsPipeTest.scala @@ -26,7 +26,7 @@ import org.mockito.stubbing.Answer import org.neo4j.cypher.internal.runtime.interpreted.ValueComparisonHelper.beEquivalentTo import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} import org.neo4j.cypher.internal.runtime.ImplicitValueConversion._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.graphdb.{Node, Relationship} import org.neo4j.kernel.impl.util.ValueUtils.{asListOfEdges, fromNodeProxy} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/PruningVarLengthExpandPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/PruningVarLengthExpandPipeTest.scala index 6323914df5050..fbc28d3487ab2 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/PruningVarLengthExpandPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/PruningVarLengthExpandPipeTest.scala @@ -26,7 +26,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.ValueComparisonHelper._ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Literal, Property, Variable} import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.{Equals, Predicate, True} import org.neo4j.cypher.internal.runtime.interpreted.commands.values.UnresolvedProperty -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.graphdb.Node import org.neo4j.internal.kernel.api.Transaction.Type import org.neo4j.internal.kernel.api.security.LoginContext diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/QueryStateTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/QueryStateTest.scala index 91671582df459..d0fe68e2a444a 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/QueryStateTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/QueryStateTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class QueryStateTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/RelationshipCountFromCountStorePipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/RelationshipCountFromCountStorePipeTest.scala index 9b9519286350a..81eb4dfc2e8da 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/RelationshipCountFromCountStorePipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/RelationshipCountFromCountStorePipeTest.scala @@ -20,13 +20,13 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.mockito.Mockito._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.util.v3_5.NameId._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.NameId._ +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.{ImplicitDummyPos, QueryStateHelper} -import org.neo4j.cypher.internal.util.v3_5.{LabelId, RelTypeId} -import org.neo4j.cypher.internal.v3_5.expressions.{LabelName, RelTypeName} +import org.opencypher.v9_0.util.{LabelId, RelTypeId} +import org.opencypher.v9_0.expressions.{LabelName, RelTypeName} import org.neo4j.values.storable.Values.longValue class RelationshipCountFromCountStorePipeTest extends CypherFunSuite with ImplicitDummyPos { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/RollUpApplyPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/RollUpApplyPipeTest.scala index 5c9fcb683e2f1..d59ba971813ad 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/RollUpApplyPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/RollUpApplyPipeTest.scala @@ -25,8 +25,8 @@ import org.mockito.invocation.InvocationOnMock import org.mockito.stubbing.Answer import org.neo4j.cypher.internal.runtime.interpreted.ValueComparisonHelper.beEquivalentTo import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values import org.neo4j.values.storable.Values.NO_VALUE import org.neo4j.values.virtual.VirtualValues diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SelectOrSemiApplyPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SelectOrSemiApplyPipeTest.scala index cb8d726a94ffa..1fb66b9d5e0c1 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SelectOrSemiApplyPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SelectOrSemiApplyPipeTest.scala @@ -23,8 +23,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper import org.neo4j.cypher.internal.runtime.interpreted.ValueComparisonHelper.beEquivalentTo import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Literal, Variable} import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates.{Equals, Not, True} -import org.neo4j.cypher.internal.util.v3_5.symbols.CTNumber -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols.CTNumber +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.intValue class SelectOrSemiApplyPipeTest extends CypherFunSuite with PipeTestSupport { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SemiApplyPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SemiApplyPipeTest.scala index b359341acd0dd..f57aa8884437b 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SemiApplyPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SemiApplyPipeTest.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper import org.neo4j.cypher.internal.runtime.interpreted.ValueComparisonHelper.beEquivalentTo -import org.neo4j.cypher.internal.util.v3_5.symbols.CTNumber -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols.CTNumber +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.intValue class SemiApplyPipeTest extends CypherFunSuite with PipeTestSupport { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SetPropertyPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SetPropertyPipeTest.scala index e39b93860dbaf..67a8aeed1127f 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SetPropertyPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SetPropertyPipeTest.scala @@ -21,23 +21,23 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.mockito.ArgumentMatchers.{anyInt, anyLong} import org.mockito.Mockito._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.planner.v3_5.spi.TokenContext import org.neo4j.cypher.internal.runtime.interpreted.commands.convert.{CommunityExpressionConverter, ExpressionConverters} import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions._ import org.neo4j.cypher.internal.runtime.interpreted.commands.values.KeyToken import org.neo4j.cypher.internal.runtime.{Operations, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.util.v3_5.{DummyPosition, PropertyKeyId} -import org.neo4j.cypher.internal.v3_5.expressions.PropertyKeyName -import org.neo4j.cypher.internal.v3_5.{expressions => ast} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.{DummyPosition, PropertyKeyId} +import org.opencypher.v9_0.expressions.PropertyKeyName +import org.opencypher.v9_0.{expressions => ast} import org.neo4j.graphdb.{Node, Relationship} import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions._ import org.neo4j.cypher.internal.runtime.interpreted.commands.values.{KeyToken, TokenType} import org.neo4j.cypher.internal.runtime.{Operations, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.util.v3_5.{InputPosition, PropertyKeyId} -import org.neo4j.cypher.internal.v3_5.expressions.PropertyKeyName +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.{InputPosition, PropertyKeyId} +import org.opencypher.v9_0.expressions.PropertyKeyName import org.neo4j.graphdb.Node import org.neo4j.values.storable.Values import org.neo4j.values.storable.Values.longValue diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SingleShortestPathPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SingleShortestPathPipeTest.scala index a383ac3de5604..a2e7ee47588d4 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SingleShortestPathPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SingleShortestPathPipeTest.scala @@ -23,8 +23,8 @@ import org.neo4j.cypher.GraphDatabaseFunSuite import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper.withQueryState import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.ShortestPathExpression import org.neo4j.cypher.internal.runtime.interpreted.commands.{ShortestPath, SingleNode} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.graphdb.Node import org.neo4j.kernel.impl.util.ValueUtils.{fromNodeProxy, fromRelationshipProxy} import org.neo4j.values.virtual.PathValue diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SkipPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SkipPipeTest.scala index 435c82d382f74..d8e9855f965ed 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SkipPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SkipPipeTest.scala @@ -23,7 +23,7 @@ import org.mockito.Mockito.{never, verify, when} import org.mockito.internal.stubbing.defaultanswers.ReturnsMocks import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Literal -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class SkipPipeTest extends CypherFunSuite { test("skip 0 should not actually pull from the input") { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SortPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SortPipeTest.scala index f89ba59922ac8..aa0280305668e 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SortPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/SortPipeTest.scala @@ -22,8 +22,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.junit.Assert._ import org.neo4j.cypher.internal.runtime.interpreted.ValueComparisonHelper._ import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values import org.neo4j.values.storable.Values.intValue import org.scalatest.mock.MockitoSugar diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/Top1WithTiesPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/Top1WithTiesPipeTest.scala index 5fd82cc876f56..314e09082dbc3 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/Top1WithTiesPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/Top1WithTiesPipeTest.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper import org.neo4j.cypher.internal.runtime.interpreted.ValueComparisonHelper.beEquivalentTo -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class Top1WithTiesPipeTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/TopPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/TopPipeTest.scala index 7d93bc64d7ec1..003ceb2afc849 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/TopPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/TopPipeTest.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Literal -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.kernel.impl.util.ValueUtils import scala.util.Random diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/TriadicSelectionPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/TriadicSelectionPipeTest.scala index ff57c4993bc65..877092bd0e7d8 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/TriadicSelectionPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/TriadicSelectionPipeTest.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.eclipse.collections.api.LongIterable import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.kernel.impl.core.NodeProxy import org.neo4j.kernel.impl.util.ValueUtils import org.neo4j.values.AnyValue diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UndirectedDirectedRelationshipByIdSeekPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UndirectedDirectedRelationshipByIdSeekPipeTest.scala index 8eb63fcceba4b..525b314ae4e04 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UndirectedDirectedRelationshipByIdSeekPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UndirectedDirectedRelationshipByIdSeekPipeTest.scala @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.ValueComparisonHelper.beEqu import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{ListLiteral, Literal} import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} import org.neo4j.cypher.internal.runtime.{Operations, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.virtual.{RelationshipValue, NodeValue} class UndirectedDirectedRelationshipByIdSeekPipeTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UnionIteratorTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UnionIteratorTest.scala index fd211e4a1073e..cbe0ef68dc207 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UnionIteratorTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UnionIteratorTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.intValue class UnionIteratorTest extends CypherFunSuite { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UnwindPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UnwindPipeTest.scala index 1d95a834947aa..c0c1bf7a97923 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UnwindPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/UnwindPipeTest.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Variable -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.intValue import org.neo4j.values.virtual.VirtualValues.list diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ValueHashJoinPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ValueHashJoinPipeTest.scala index af9ede1dede91..d1d52c33acd91 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ValueHashJoinPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/ValueHashJoinPipeTest.scala @@ -25,8 +25,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.ValueComparisonHelper.beEqu import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Variable import org.neo4j.cypher.internal.runtime.interpreted.symbols.SymbolTable import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper, TestableIterator} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values.{doubleArray, intArray, intValue} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/VarLengthExpandPipeTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/VarLengthExpandPipeTest.scala index 2e789a243f346..8b7ebb0cebab0 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/VarLengthExpandPipeTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/VarLengthExpandPipeTest.scala @@ -27,10 +27,10 @@ import org.neo4j.cypher.internal.runtime.interpreted.ValueComparisonHelper._ import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} import org.neo4j.cypher.internal.runtime.ImplicitValueConversion._ import org.neo4j.cypher.internal.runtime.interpreted.symbols.SymbolTable -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.runtime.QueryContext -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.graphdb.{Node, Relationship} import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/AvgFunctionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/AvgFunctionTest.scala index 801c377131070..09541a57f8429 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/AvgFunctionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/AvgFunctionTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.{NO_VALUE, doubleValue, intValue, longValue} class AvgFunctionTest extends CypherFunSuite with AggregateTest { diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/CollectFunctionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/CollectFunctionTest.scala index 52a526282f5bc..1d81d442fb9da 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/CollectFunctionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/CollectFunctionTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.{NO_VALUE, intValue} import org.neo4j.values.virtual.VirtualValues.{EMPTY_LIST, list} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/CountTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/CountTest.scala index 15ac1d0fcb60b..05ce0892b85be 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/CountTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/CountTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.LongValue import org.neo4j.values.storable.Values.{NO_VALUE, intValue, stringValue} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/MaxFunctionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/MaxFunctionTest.scala index 34b771d866f12..a7975af6ec5c5 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/MaxFunctionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/MaxFunctionTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.{doubleValue, intValue, stringValue} import org.neo4j.values.storable.{DoubleValue, IntValue, Values} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/MinFunctionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/MinFunctionTest.scala index d9b7c272d7d1f..f7d648100de43 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/MinFunctionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/MinFunctionTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.{doubleValue, intValue, stringValue} import org.neo4j.values.storable.{IntValue, Values} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/PercentileFunctionsTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/PercentileFunctionsTest.scala index 42098df118d83..c31b225573025 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/PercentileFunctionsTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/PercentileFunctionsTest.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Expression, Literal, NumericHelper, Variable} import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.kernel.impl.util.ValueUtils import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values.doubleValue diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/StdevFunctionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/StdevFunctionTest.scala index b428ca8b05124..bb81d52c09929 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/StdevFunctionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/StdevFunctionTest.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.{Expression, NumericHelper, Variable} import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.kernel.impl.util.ValueUtils import org.neo4j.values.storable.DoubleValue diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/SumFunctionTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/SumFunctionTest.scala index f5e37b2d36cd4..090cb0a623c2c 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/SumFunctionTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/aggregation/SumFunctionTest.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values._ import org.neo4j.values.storable.{DoubleValue, LongValue, Values} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/HistoryTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/HistoryTest.scala index 3c00a43683b79..d9ce2be651662 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/HistoryTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/HistoryTest.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes.matching import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.CommunityExecutionContextFactory -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.graphdb.{Relationship, RelationshipType} import org.neo4j.values.storable.Values.{stringArray, stringValue} import org.neo4j.values.virtual.VirtualValues.{EMPTY_MAP, relationshipValue, nodeValue} diff --git a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/PatternRelationshipTest.scala b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/PatternRelationshipTest.scala index 2fbc02c42102f..913c3526803e5 100644 --- a/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/PatternRelationshipTest.scala +++ b/community/cypher/interpreted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/matching/PatternRelationshipTest.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes.matching import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Literal -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection class PatternRelationshipTest extends CypherFunSuite { diff --git a/community/cypher/ir-3.5/LICENSES.txt b/community/cypher/ir-3.5/LICENSES.txt index 3689438757721..31279f00f8036 100644 --- a/community/cypher/ir-3.5/LICENSES.txt +++ b/community/cypher/ir-3.5/LICENSES.txt @@ -5,6 +5,12 @@ libraries. For an overview of the licenses see the NOTICE.txt file. ------------------------------------------------------------------------------ Apache Software License, Version 2.0 Apache Commons Lang + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala ------------------------------------------------------------------------------ diff --git a/community/cypher/ir-3.5/NOTICE.txt b/community/cypher/ir-3.5/NOTICE.txt index 1c8482fcca764..100e3951611ac 100644 --- a/community/cypher/ir-3.5/NOTICE.txt +++ b/community/cypher/ir-3.5/NOTICE.txt @@ -28,6 +28,12 @@ Third-party licenses Apache Software License, Version 2.0 Apache Commons Lang + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala diff --git a/community/cypher/ir-3.5/pom.xml b/community/cypher/ir-3.5/pom.xml index 37384cc8f45de..7dafa5cecdc14 100644 --- a/community/cypher/ir-3.5/pom.xml +++ b/community/cypher/ir-3.5/pom.xml @@ -59,12 +59,31 @@ - + + + org.opencypher + util-9.0 + ${openCypher.version} + test-jar + test + + + + org.opencypher + expressions-9.0 + ${openCypher.version} + - org.neo4j - openCypher-frontend-1 - ${project.version} + org.opencypher + ast-9.0 + ${openCypher.version} + + + + org.opencypher + front-end-9.0 + ${openCypher.version} @@ -104,13 +123,6 @@ - - org.neo4j - neo4j-cypher-util-3.5 - ${project.version} - test-jar - test - diff --git a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/CreatesPropertyKeys.scala b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/CreatesPropertyKeys.scala index a5a2a33786664..8ab3111329183 100644 --- a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/CreatesPropertyKeys.scala +++ b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/CreatesPropertyKeys.scala @@ -19,8 +19,7 @@ */ package org.neo4j.cypher.internal.ir.v3_5 -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, MapExpression, PropertyKeyName} - +import org.opencypher.v9_0.expressions.{Expression, MapExpression, PropertyKeyName} /* * Used to simplify finding overlap between writing and reading properties */ diff --git a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/MutatingPattern.scala b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/MutatingPattern.scala index 6142296bb9861..d1ce14b55063f 100644 --- a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/MutatingPattern.scala +++ b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/MutatingPattern.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.ir.v3_5 -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ import scala.util.hashing.MurmurHash3 diff --git a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/PatternRelationship.scala b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/PatternRelationship.scala index ddcea8d87d95e..96e17ac380dcd 100644 --- a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/PatternRelationship.scala +++ b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/PatternRelationship.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.ir.v3_5 -import org.neo4j.cypher.internal.v3_5.expressions.{RelTypeName, SemanticDirection} +import org.opencypher.v9_0.expressions.{RelTypeName, SemanticDirection} final case class PatternRelationship(name: String, nodes: (String, String), dir: SemanticDirection, types: Seq[RelTypeName], length: PatternLength) { diff --git a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/PeriodicCommit.scala b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/PeriodicCommit.scala index ea93d62cc656b..fe563932c733f 100644 --- a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/PeriodicCommit.scala +++ b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/PeriodicCommit.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.ir.v3_5 -import org.neo4j.cypher.internal.frontend.v3_5.ast.PeriodicCommitHint +import org.opencypher.v9_0.ast.PeriodicCommitHint case class PeriodicCommit(batchSize: Option[Long]) diff --git a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/PlannerQuery.scala b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/PlannerQuery.scala index b5a1047476085..e07115372fb95 100644 --- a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/PlannerQuery.scala +++ b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/PlannerQuery.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.ir.v3_5 -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, InternalException} -import org.neo4j.cypher.internal.frontend.v3_5.ast.Hint -import org.neo4j.cypher.internal.v3_5.expressions.{LabelName, Variable} +import org.opencypher.v9_0.util.{Cardinality, InternalException} +import org.opencypher.v9_0.ast.Hint +import org.opencypher.v9_0.expressions.{LabelName, Variable} import scala.annotation.tailrec import scala.collection.GenSeq diff --git a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/Predicate.scala b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/Predicate.scala index e7e2178f64271..575cbbfe5642f 100644 --- a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/Predicate.scala +++ b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/Predicate.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.ir.v3_5 -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.expressions.Expression case class Predicate(dependencies: Set[String], expr: Expression) { diff --git a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/QueryGraph.scala b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/QueryGraph.scala index c5579d01ee935..df26d895306e2 100644 --- a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/QueryGraph.scala +++ b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/QueryGraph.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.ir.v3_5 -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.prettifier.ExpressionStringifier +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.frontend.prettifier.ExpressionStringifier import org.neo4j.cypher.internal.ir.v3_5.helpers.ExpressionConverters._ -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ import scala.collection.mutable.ArrayBuffer import scala.collection.{GenSeq, GenTraversableOnce, mutable} diff --git a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/QueryHorizon.scala b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/QueryHorizon.scala index bc4476a609dbb..59a63b4d7953d 100644 --- a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/QueryHorizon.scala +++ b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/QueryHorizon.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.ir.v3_5 -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.frontend.v3_5.ast.AliasedReturnItem -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, StringLiteral, Variable} +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.ast.AliasedReturnItem +import org.opencypher.v9_0.expressions.{Expression, StringLiteral, Variable} trait QueryHorizon { diff --git a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/QueryShuffle.scala b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/QueryShuffle.scala index 5cd8966eec544..4076cbed67cf1 100644 --- a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/QueryShuffle.scala +++ b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/QueryShuffle.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.ir.v3_5 -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.frontend.v3_5.ast.{Limit, Skip, SortItem} -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.ast.{Limit, Skip, SortItem} +import org.opencypher.v9_0.expressions.Expression final case class QueryShuffle(sortItems: Seq[SortItem] = Seq.empty, skip: Option[Expression] = None, diff --git a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/Selections.scala b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/Selections.scala index e68e24e792a34..09260fd2f0fef 100644 --- a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/Selections.scala +++ b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/Selections.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.ir.v3_5 import org.neo4j.cypher.internal.ir.v3_5.helpers.ExpressionConverters._ -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ case class Selections(predicates: Set[Predicate] = Set.empty) { def isEmpty = predicates.isEmpty diff --git a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/ShortestPathPattern.scala b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/ShortestPathPattern.scala index d6461a799d8d7..08848cb377725 100644 --- a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/ShortestPathPattern.scala +++ b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/ShortestPathPattern.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.ir.v3_5 -import org.neo4j.cypher.internal.v3_5.expressions.ShortestPaths +import org.opencypher.v9_0.expressions.ShortestPaths final case class ShortestPathPattern(name: Option[String], rel: PatternRelationship, single: Boolean) (val expr: ShortestPaths) { diff --git a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/UpdateGraph.scala b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/UpdateGraph.scala index e9f73554a9a11..187f6003c41e7 100644 --- a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/UpdateGraph.scala +++ b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/UpdateGraph.scala @@ -19,11 +19,13 @@ */ package org.neo4j.cypher.internal.ir.v3_5 -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions._ -import org.neo4j.cypher.internal.v3_5.functions.Labels +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.ast.semantics.SemanticTable +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.expressions._ + +import org.opencypher.v9_0.expressions.functions.Labels + import scala.annotation.tailrec diff --git a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/helpers/ExpressionConverters.scala b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/helpers/ExpressionConverters.scala index 876032d911a19..f9211efb9fd26 100644 --- a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/helpers/ExpressionConverters.scala +++ b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/helpers/ExpressionConverters.scala @@ -19,14 +19,15 @@ */ package org.neo4j.cypher.internal.ir.v3_5.helpers -import org.neo4j.cypher.internal.util.v3_5.{Rewriter, topDown} -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.{LabelPredicateNormalizer, MatchPredicateNormalizerChain, PropertyPredicateNormalizer, addUniquenessPredicates} -import org.neo4j.cypher.internal.v3_5.expressions.{Ands, Expression, HasLabels, Not, Ors, PatternComprehension, PatternExpression, RelationshipChain, Variable} -import org.neo4j.cypher.internal.util.v3_5.UnNamedNameGenerator._ +import org.opencypher.v9_0.util.{Rewriter, topDown} +import org.opencypher.v9_0.rewriting.rewriters.{LabelPredicateNormalizer, MatchPredicateNormalizerChain, PropertyPredicateNormalizer, addUniquenessPredicates} + +import org.opencypher.v9_0.expressions.{Ands, Expression, HasLabels, Not, Ors, PatternComprehension, PatternExpression, RelationshipChain, Variable} +import org.opencypher.v9_0.util.UnNamedNameGenerator._ import org.neo4j.cypher.internal.ir.v3_5._ import org.neo4j.cypher.internal.ir.v3_5.helpers.PatternConverters._ import org.neo4j.cypher.internal.ir.v3_5.QueryGraph -import org.neo4j.cypher.internal.v3_5.expressions.Range +import org.opencypher.v9_0.expressions.Range object ExpressionConverters { val normalizer = MatchPredicateNormalizerChain(PropertyPredicateNormalizer, LabelPredicateNormalizer) diff --git a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/helpers/PatternConverters.scala b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/helpers/PatternConverters.scala index d12bc454a8636..48057ada5d130 100644 --- a/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/helpers/PatternConverters.scala +++ b/community/cypher/ir-3.5/src/main/scala/org/neo4j/cypher/internal/ir/v3_5/helpers/PatternConverters.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.ir.v3_5.helpers -import org.neo4j.cypher.internal.util.v3_5.{FreshIdNameGenerator, InternalException} +import org.opencypher.v9_0.util.{FreshIdNameGenerator, InternalException} import org.neo4j.cypher.internal.ir.v3_5.helpers.ExpressionConverters._ import org.neo4j.cypher.internal.ir.v3_5.{PatternRelationship, ShortestPathPattern} -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.expressions._ object PatternConverters { diff --git a/community/cypher/ir-3.5/src/test/scala/org/neo4j/cypher/internal/ir/v3_5/SelectivityTest.scala b/community/cypher/ir-3.5/src/test/scala/org/neo4j/cypher/internal/ir/v3_5/SelectivityTest.scala index fbec9ab91f650..34daab4bf6e23 100644 --- a/community/cypher/ir-3.5/src/test/scala/org/neo4j/cypher/internal/ir/v3_5/SelectivityTest.scala +++ b/community/cypher/ir-3.5/src/test/scala/org/neo4j/cypher/internal/ir/v3_5/SelectivityTest.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.ir.v3_5 -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, Selectivity} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.{Cardinality, Selectivity} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class SelectivityTest extends CypherFunSuite { diff --git a/community/cypher/planner-spi-3.5/LICENSES.txt b/community/cypher/planner-spi-3.5/LICENSES.txt index ce26bb13a205e..d0efacac18054 100644 --- a/community/cypher/planner-spi-3.5/LICENSES.txt +++ b/community/cypher/planner-spi-3.5/LICENSES.txt @@ -5,6 +5,12 @@ libraries. For an overview of the licenses see the NOTICE.txt file. ------------------------------------------------------------------------------ Apache Software License, Version 2.0 Apache Commons Lang + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala ------------------------------------------------------------------------------ diff --git a/community/cypher/planner-spi-3.5/NOTICE.txt b/community/cypher/planner-spi-3.5/NOTICE.txt index e07e0061191f2..d70842ac67895 100644 --- a/community/cypher/planner-spi-3.5/NOTICE.txt +++ b/community/cypher/planner-spi-3.5/NOTICE.txt @@ -28,6 +28,12 @@ Third-party licenses Apache Software License, Version 2.0 Apache Commons Lang + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala diff --git a/community/cypher/planner-spi-3.5/pom.xml b/community/cypher/planner-spi-3.5/pom.xml index ebd251bc3424b..47c954700df91 100644 --- a/community/cypher/planner-spi-3.5/pom.xml +++ b/community/cypher/planner-spi-3.5/pom.xml @@ -62,9 +62,9 @@ - org.neo4j - neo4j-cypher-util-3.5 - ${project.version} + org.opencypher + util-9.0 + ${openCypher.version} diff --git a/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/GraphStatistics.scala b/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/GraphStatistics.scala index e3de215771abb..3ac1fc45b437e 100644 --- a/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/GraphStatistics.scala +++ b/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/GraphStatistics.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.planner.v3_5.spi -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, LabelId, RelTypeId, Selectivity} +import org.opencypher.v9_0.util.{Cardinality, LabelId, RelTypeId, Selectivity} object GraphStatistics { val DEFAULT_RANGE_SELECTIVITY = Selectivity.of(0.3).get diff --git a/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/IndexDescriptor.scala b/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/IndexDescriptor.scala index 7503801f3b56b..9c87f9d41e479 100644 --- a/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/IndexDescriptor.scala +++ b/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/IndexDescriptor.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.planner.v3_5.spi -import org.neo4j.cypher.internal.util.v3_5.{LabelId, PropertyKeyId} +import org.opencypher.v9_0.util.{LabelId, PropertyKeyId} object IndexDescriptor { def apply(label: Int, property: Int): IndexDescriptor = IndexDescriptor(LabelId(label), Seq(PropertyKeyId(property))) diff --git a/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/InstrumentedGraphStatistics.scala b/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/InstrumentedGraphStatistics.scala index 95b6e2e194a65..119cac55fb785 100644 --- a/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/InstrumentedGraphStatistics.scala +++ b/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/InstrumentedGraphStatistics.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.planner.v3_5.spi import java.lang.Math.{abs, max} -import org.neo4j.cypher.internal.util.v3_5.{Cardinality, LabelId, RelTypeId, Selectivity} +import org.opencypher.v9_0.util.{Cardinality, LabelId, RelTypeId, Selectivity} import scala.collection.mutable diff --git a/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/PlanContext.scala b/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/PlanContext.scala index 30448eeadf231..40f6e5bd68fc2 100644 --- a/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/PlanContext.scala +++ b/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/PlanContext.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.planner.v3_5.spi -import org.neo4j.cypher.internal.frontend.v3_5.phases.InternalNotificationLogger +import org.opencypher.v9_0.frontend.phases.InternalNotificationLogger import org.neo4j.cypher.internal.v3_5.logical.plans.{ProcedureSignature, QualifiedName, UserFunctionSignature} /** diff --git a/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/PlannerName.scala b/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/PlannerName.scala index a2435942170a9..1c5f9bbcf2111 100644 --- a/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/PlannerName.scala +++ b/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/PlannerName.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.planner.v3_5.spi -import org.neo4j.cypher.internal.frontend.v3_5.PlannerName +import org.opencypher.v9_0.frontend.PlannerName sealed abstract class CostBasedPlannerName extends PlannerName { val toTextOutput = "COST" diff --git a/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/PlanningAttributes.scala b/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/PlanningAttributes.scala index 002de98f57aaf..ca9f52c567248 100644 --- a/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/PlanningAttributes.scala +++ b/community/cypher/planner-spi-3.5/src/main/scala/org/neo4j/cypher/internal/planner/v3_5/spi/PlanningAttributes.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.planner.v3_5.spi import org.neo4j.cypher.internal.ir.v3_5.PlannerQuery -import org.neo4j.cypher.internal.util.v3_5.Cardinality -import org.neo4j.cypher.internal.util.v3_5.attribution.Attribute +import org.opencypher.v9_0.util.Cardinality +import org.opencypher.v9_0.util.attribution.Attribute object PlanningAttributes { class Solveds extends Attribute[PlannerQuery] diff --git a/community/cypher/pom.xml b/community/cypher/pom.xml index 7774426de095b..36657c0e39996 100644 --- a/community/cypher/pom.xml +++ b/community/cypher/pom.xml @@ -20,6 +20,7 @@ notice-gpl-prefix.txt GPL-3-header.txt + 1.0.0 @@ -37,12 +38,9 @@ - frontend-3.5 - util-3.5 ir-3.5 cypher-planner-3.5 planner-spi-3.5 - expressions-3.5 cypher cypher-logical-plans-3.5 runtime-util diff --git a/community/cypher/runtime-util/LICENSES.txt b/community/cypher/runtime-util/LICENSES.txt index 4f7f70dd7aff4..f0b791363a078 100644 --- a/community/cypher/runtime-util/LICENSES.txt +++ b/community/cypher/runtime-util/LICENSES.txt @@ -8,6 +8,12 @@ Apache Software License, Version 2.0 Lucene Core Lucene Memory Netty/All-in-One + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala ------------------------------------------------------------------------------ diff --git a/community/cypher/runtime-util/NOTICE.txt b/community/cypher/runtime-util/NOTICE.txt index 314af68a0ba65..5e08feb1227d6 100644 --- a/community/cypher/runtime-util/NOTICE.txt +++ b/community/cypher/runtime-util/NOTICE.txt @@ -31,6 +31,12 @@ Apache Software License, Version 2.0 Lucene Core Lucene Memory Netty/All-in-One + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala diff --git a/community/cypher/runtime-util/pom.xml b/community/cypher/runtime-util/pom.xml index 7796a69e4452b..8fe1cf2b2c29a 100644 --- a/community/cypher/runtime-util/pom.xml +++ b/community/cypher/runtime-util/pom.xml @@ -129,17 +129,17 @@ - org.neo4j - neo4j-cypher-util-3.5 - ${project.version} + org.opencypher + util-9.0 + ${openCypher.version} test-jar test - org.neo4j - neo4j-cypher-expression-3.5 - ${project.version} + org.opencypher + expressions-9.0 + ${openCypher.version} test-jar test diff --git a/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/exceptionHandler.scala b/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/exceptionHandler.scala index 4f95d1f410e0f..9f6aa99ad8117 100644 --- a/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/exceptionHandler.scala +++ b/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/exceptionHandler.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher -import org.neo4j.cypher.internal.util.v3_5.spi.MapToPublicExceptions -import org.neo4j.cypher.internal.util.v3_5.{CypherException => InternalCypherException} +import org.opencypher.v9_0.util.spi.MapToPublicExceptions +import org.opencypher.v9_0.util.{CypherException => InternalCypherException} import org.neo4j.values.utils._ object exceptionHandler extends MapToPublicExceptions[CypherException] { diff --git a/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/ExecutionMode.scala b/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/ExecutionMode.scala index 902d8e6cad2fa..40cec59b56cb4 100644 --- a/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/ExecutionMode.scala +++ b/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/ExecutionMode.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime -import org.neo4j.cypher.internal.util.v3_5.InvalidSemanticsException +import org.opencypher.v9_0.util.InvalidSemanticsException object ExecutionMode { def cantMixProfileAndExplain: Nothing = diff --git a/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/QueryContext.scala b/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/QueryContext.scala index 38b95daf4cd61..229b08c87fa6b 100644 --- a/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/QueryContext.scala +++ b/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/QueryContext.scala @@ -23,7 +23,7 @@ import java.net.URL import org.eclipse.collections.api.iterator.LongIterator import org.neo4j.cypher.internal.planner.v3_5.spi.{IdempotentResult, IndexDescriptor, KernelStatisticProvider, TokenContext} -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.cypher.internal.v3_5.logical.plans.QualifiedName import org.neo4j.graphdb.{Node, Path, PropertyContainer} import org.neo4j.internal.kernel.api.helpers.RelationshipSelectionCursor diff --git a/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/Runtime.scala b/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/Runtime.scala index ae05c41c07f00..e95799896ef55 100644 --- a/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/Runtime.scala +++ b/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/Runtime.scala @@ -19,14 +19,14 @@ */ package org.neo4j.cypher.internal.runtime -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable import org.neo4j.cypher.internal.planner.v3_5.spi.TokenContext -import org.neo4j.cypher.internal.util.v3_5.symbols.CypherType -import org.neo4j.cypher.internal.v3_5.expressions.Expression import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan import org.neo4j.internal.kernel.api.Transaction import org.neo4j.kernel.impl.query.{QueryExecution, ResultBuffer} import org.neo4j.values.virtual.MapValue +import org.opencypher.v9_0.ast.semantics.SemanticTable +import org.opencypher.v9_0.expressions.Expression +import org.opencypher.v9_0.util.symbols.CypherType // =============================================== / // RUNTIME INTERFACES, implemented by each runtime / diff --git a/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/RuntimeJavaValueConverter.scala b/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/RuntimeJavaValueConverter.scala index 3f8301b3f6e07..e6959ae196828 100644 --- a/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/RuntimeJavaValueConverter.scala +++ b/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/RuntimeJavaValueConverter.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime import java.util.{List => JavaList, Map => JavaMap} -import org.neo4j.cypher.internal.util.v3_5.Eagerly.immutableMapValues +import org.opencypher.v9_0.util.Eagerly.immutableMapValues import org.neo4j.cypher.result.QueryResult.{QueryResultVisitor, Record} import org.neo4j.values.AnyValue diff --git a/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/RuntimeScalaValueConverter.scala b/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/RuntimeScalaValueConverter.scala index 41de098d38ac2..5018e19a4a832 100644 --- a/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/RuntimeScalaValueConverter.scala +++ b/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/RuntimeScalaValueConverter.scala @@ -23,7 +23,7 @@ import java.lang.{Iterable => JavaIterable} import java.util import java.util.{Map => JavaMap} -import org.neo4j.cypher.internal.util.v3_5.Eagerly.immutableMapValues +import org.opencypher.v9_0.util.Eagerly.immutableMapValues import scala.collection.JavaConverters._ import scala.collection.immutable diff --git a/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/planDescription/InternalPlanDescription.scala b/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/planDescription/InternalPlanDescription.scala index 6099c25ea850b..aef056bc81458 100644 --- a/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/planDescription/InternalPlanDescription.scala +++ b/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/planDescription/InternalPlanDescription.scala @@ -23,16 +23,15 @@ import java.util import org.neo4j.cypher.exceptionHandler import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments._ -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.symbols.CypherType -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.symbols.CypherType +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.cypher.internal.v3_5.logical.plans.{QualifiedName, SeekableArgs} -import org.neo4j.cypher.internal.v3_5.{expressions => ast} import org.neo4j.graphdb.ExecutionPlanDescription import org.neo4j.graphdb.ExecutionPlanDescription.ProfilerStatistics +import org.opencypher.v9_0.{expressions => ast} -import scala.annotation.tailrec import scala.collection.mutable import scala.collection.mutable.ArrayBuffer diff --git a/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/planDescription/LogicalPlan2PlanDescription.scala b/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/planDescription/LogicalPlan2PlanDescription.scala index 46af46a73892b..615aec8306789 100644 --- a/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/planDescription/LogicalPlan2PlanDescription.scala +++ b/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/planDescription/LogicalPlan2PlanDescription.scala @@ -19,12 +19,12 @@ */ package org.neo4j.cypher.internal.runtime.planDescription -import org.neo4j.cypher.internal.frontend.v3_5.PlannerName +import org.opencypher.v9_0.frontend.PlannerName import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments._ -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.v3_5.expressions.{FunctionInvocation, FunctionName, LabelToken, MapExpression, Namespace, PropertyKeyToken, Expression => ASTExpression} -import org.neo4j.cypher.internal.v3_5.functions.Point +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.expressions.{FunctionInvocation, FunctionName, LabelToken, MapExpression, Namespace, PropertyKeyToken, Expression => ASTExpression} +import org.opencypher.v9_0.expressions.functions.Point import org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.v3_5.logical.plans._ diff --git a/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/planDescription/PlanDescriptionArgumentSerializer.scala b/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/planDescription/PlanDescriptionArgumentSerializer.scala index 74f0f7c5404f2..da49b8030a148 100644 --- a/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/planDescription/PlanDescriptionArgumentSerializer.scala +++ b/community/cypher/runtime-util/src/main/scala/org/neo4j/cypher/internal/runtime/planDescription/PlanDescriptionArgumentSerializer.scala @@ -20,10 +20,10 @@ package org.neo4j.cypher.internal.runtime.planDescription import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments._ -import org.neo4j.cypher.internal.util.v3_5.UnNamedNameGenerator._ -import org.neo4j.cypher.internal.frontend.v3_5.prettifier.ExpressionStringifier -import org.neo4j.cypher.internal.v3_5.expressions -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.UnNamedNameGenerator._ +import org.opencypher.v9_0.frontend.prettifier.ExpressionStringifier +import org.opencypher.v9_0.expressions +import org.opencypher.v9_0.expressions.SemanticDirection object PlanDescriptionArgumentSerializer { private val SEPARATOR = ", " diff --git a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/GraphDatabaseFunSuite.scala b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/GraphDatabaseFunSuite.scala index c24b14f199cde..a49ae91cfe67e 100644 --- a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/GraphDatabaseFunSuite.scala +++ b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/GraphDatabaseFunSuite.scala @@ -19,6 +19,6 @@ */ package org.neo4j.cypher -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite abstract class GraphDatabaseFunSuite extends CypherFunSuite with GraphDatabaseTestSupport diff --git a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/GraphDatabaseTestSupport.scala b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/GraphDatabaseTestSupport.scala index 1028436b4989c..fc90e06494bcb 100644 --- a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/GraphDatabaseTestSupport.scala +++ b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/GraphDatabaseTestSupport.scala @@ -23,7 +23,7 @@ import java.io.File import org.neo4j.cypher.internal.javacompat.GraphDatabaseCypherService import org.neo4j.cypher.internal.planner.v3_5.spi.PlanContext -import org.neo4j.cypher.internal.util.v3_5.test_helpers.{CypherFunSuite, CypherTestSupport} +import org.opencypher.v9_0.util.test_helpers.{CypherFunSuite, CypherTestSupport} import org.neo4j.graphdb._ import org.neo4j.graphdb.config.Setting import org.neo4j.internal.kernel.api.procs.{ProcedureSignature, UserFunctionSignature} diff --git a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/ArrayBackedMapTest.scala b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/ArrayBackedMapTest.scala index 5b716a2132d9c..ccc60aca7aa36 100644 --- a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/ArrayBackedMapTest.scala +++ b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/ArrayBackedMapTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class ArrayBackedMapTest extends CypherFunSuite { diff --git a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/CounterTest.scala b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/CounterTest.scala index d856e8ae6261c..fd525a0b4a9ee 100644 --- a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/CounterTest.scala +++ b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/CounterTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class CounterTest extends CypherFunSuite { diff --git a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/CreateTempFileTestSupport.scala b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/CreateTempFileTestSupport.scala index 09baa5d37dbe2..b053bdecf41d7 100644 --- a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/CreateTempFileTestSupport.scala +++ b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/CreateTempFileTestSupport.scala @@ -23,7 +23,7 @@ import java.io.{FileOutputStream, OutputStreamWriter, PrintWriter} import java.nio.file.{Files, Path} import java.util.zip.{GZIPOutputStream, ZipEntry, ZipOutputStream} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.{CypherFunSuite, CypherTestSupport} +import org.opencypher.v9_0.util.test_helpers.{CypherFunSuite, CypherTestSupport} import org.neo4j.io.fs.FileUtils import scala.io.Codec diff --git a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/RuntimeJavaValueConverterTest.scala b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/RuntimeJavaValueConverterTest.scala index 9975fd750516b..38e647bbe134e 100644 --- a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/RuntimeJavaValueConverterTest.scala +++ b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/RuntimeJavaValueConverterTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import scala.collection.convert.Wrappers.SeqWrapper diff --git a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/RuntimeScalaValueConverterTest.scala b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/RuntimeScalaValueConverterTest.scala index b8159e4023844..3456f5b7b3f93 100644 --- a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/RuntimeScalaValueConverterTest.scala +++ b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/RuntimeScalaValueConverterTest.scala @@ -23,7 +23,7 @@ import java.util import java.util.Arrays.asList import java.util.Collections.{emptyList, emptyMap, singletonMap, singleton => singletonSet} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class RuntimeScalaValueConverterTest extends CypherFunSuite { diff --git a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/CompactedPlanDescriptionTest.scala b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/CompactedPlanDescriptionTest.scala index 22d4635f17270..1bad7dd9cd87e 100644 --- a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/CompactedPlanDescriptionTest.scala +++ b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/CompactedPlanDescriptionTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.planDescription import org.mockito.Mockito._ import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments.{DbHits, Rows, Time} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.scalatest.mock.MockitoSugar class CompactedPlanDescriptionTest extends CypherFunSuite with MockitoSugar { diff --git a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/InternalPlanDescriptionTest.scala b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/InternalPlanDescriptionTest.scala index 018505d445540..af823a91bdc5d 100644 --- a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/InternalPlanDescriptionTest.scala +++ b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/InternalPlanDescriptionTest.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.runtime.planDescription -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class InternalPlanDescriptionTest extends CypherFunSuite { diff --git a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/LogicalPlan2PlanDescriptionTest.scala b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/LogicalPlan2PlanDescriptionTest.scala index a664e257cdfd0..a8632b32e85a3 100644 --- a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/LogicalPlan2PlanDescriptionTest.scala +++ b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/LogicalPlan2PlanDescriptionTest.scala @@ -22,10 +22,10 @@ package org.neo4j.cypher.internal.runtime.planDescription import org.neo4j.cypher.internal.planner.v3_5.spi.IDPPlannerName import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments._ -import org.neo4j.cypher.internal.util.v3_5._ -import org.neo4j.cypher.internal.util.v3_5.attribution.{Id, IdGen, SequentialIdGen} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.{SemanticDirection, LabelName => AstLabelName, _} +import org.opencypher.v9_0.util._ +import org.opencypher.v9_0.util.attribution.{Id, IdGen, SequentialIdGen} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.{SemanticDirection, LabelName => AstLabelName, _} import org.neo4j.cypher.internal.v3_5.logical.plans._ import org.scalatest.prop.TableDrivenPropertyChecks diff --git a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/PlanDescriptionArgumentSerializerTests.scala b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/PlanDescriptionArgumentSerializerTests.scala index cfbef9ea6c383..04a70d1b5c84b 100644 --- a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/PlanDescriptionArgumentSerializerTests.scala +++ b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/PlanDescriptionArgumentSerializerTests.scala @@ -21,11 +21,11 @@ package org.neo4j.cypher.internal.runtime.planDescription import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments._ import org.neo4j.cypher.internal.runtime.planDescription.PlanDescriptionArgumentSerializer.serialize -import org.neo4j.cypher.internal.util.v3_5.attribution.SequentialIdGen -import org.neo4j.cypher.internal.util.v3_5.symbols.{CTBoolean, CTList, CTNode, CTString} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.util.v3_5.DummyPosition -import org.neo4j.cypher.internal.v3_5.expressions.{DummyExpression, SemanticDirection, SignedDecimalIntegerLiteral} +import org.opencypher.v9_0.util.attribution.SequentialIdGen +import org.opencypher.v9_0.util.symbols.{CTBoolean, CTList, CTNode, CTString} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.DummyPosition +import org.opencypher.v9_0.expressions.{DummyExpression, SemanticDirection, SignedDecimalIntegerLiteral} import org.neo4j.cypher.internal.v3_5.logical.plans.{LogicalPlan, NestedPlanExpression} import org.neo4j.cypher.internal.v3_5.logical.plans diff --git a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/RenderSummaryTest.scala b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/RenderSummaryTest.scala index 744758a6945ab..3a585fa7b6eac 100644 --- a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/RenderSummaryTest.scala +++ b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/RenderSummaryTest.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.runtime.planDescription import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments.{DbHits, Rows} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class RenderSummaryTest extends CypherFunSuite { diff --git a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/RenderTreeTableTest.scala b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/RenderTreeTableTest.scala index 279f1c6de3f79..13ad84a76da2b 100644 --- a/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/RenderTreeTableTest.scala +++ b/community/cypher/runtime-util/src/test/scala/org/neo4j/cypher/internal/runtime/planDescription/RenderTreeTableTest.scala @@ -23,10 +23,10 @@ import java.util.Locale import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments._ -import org.neo4j.cypher.internal.util.v3_5.attribution.{Id, SequentialIdGen} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.{CypherFunSuite, WindowsStringSafe} -import org.neo4j.cypher.internal.util.v3_5.{DummyPosition, LabelId, NonEmptyList, PropertyKeyId} -import org.neo4j.cypher.internal.v3_5.expressions.{Expression => ASTExpression, LabelName => ASTLabelName, Range => ASTRange, _} +import org.opencypher.v9_0.util.attribution.{Id, SequentialIdGen} +import org.opencypher.v9_0.util.test_helpers.{CypherFunSuite, WindowsStringSafe} +import org.opencypher.v9_0.util.{DummyPosition, LabelId, NonEmptyList, PropertyKeyId} +import org.opencypher.v9_0.expressions.{Expression => ASTExpression, LabelName => ASTLabelName, Range => ASTRange, _} import org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.v3_5.logical.plans._ import org.scalatest.BeforeAndAfterAll diff --git a/community/cypher/util-3.5/ASL-2-header.txt b/community/cypher/util-3.5/ASL-2-header.txt deleted file mode 100644 index f1f80695adcd5..0000000000000 --- a/community/cypher/util-3.5/ASL-2-header.txt +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (c) ${inceptionYear}-${currentYear} "Neo Technology," -Network Engine for Objects in Lund AB [http://neotechnology.com] - -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. diff --git a/community/cypher/util-3.5/LICENSES.txt b/community/cypher/util-3.5/LICENSES.txt deleted file mode 100644 index 3689438757721..0000000000000 --- a/community/cypher/util-3.5/LICENSES.txt +++ /dev/null @@ -1,291 +0,0 @@ -This file contains the full license text of the included third party -libraries. For an overview of the licenses see the NOTICE.txt file. - - ------------------------------------------------------------------------------- -Apache Software License, Version 2.0 - Apache Commons Lang - parboiled-core - parboiled-scala ------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. - - - ------------------------------------------------------------------------------- -BSD - Scala License - Scala Library ------------------------------------------------------------------------------- - -SCALA LICENSE - -Copyright (c) 2002-2012 EPFL, Lausanne, unless otherwise specified. -All rights reserved. - -This software was developed by the Programming Methods Laboratory of the -Swiss Federal Institute of Technology (EPFL), Lausanne, Switzerland. - -Permission to use, copy, modify, and distribute this software in source -or binary form for any purpose with or without fee is hereby granted, -provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the EPFL nor the names of its contributors - may be used to endorse or promote products derived from this - software without specific prior written permission. - - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - - - ------------------------------------------------------------------------------- -BSD License - Scala Compiler ------------------------------------------------------------------------------- - -Copyright (c) , -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - - diff --git a/community/cypher/util-3.5/NOTICE.txt b/community/cypher/util-3.5/NOTICE.txt deleted file mode 100644 index 2303e16bccab4..0000000000000 --- a/community/cypher/util-3.5/NOTICE.txt +++ /dev/null @@ -1,29 +0,0 @@ -Copyright (c) 2002-2018, "Neo Technology," -Network Engine for Objects in Lund AB [http://neotechnology.com] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. - -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. - -Full license texts are found in LICENSES.txt. - - -Third-party licenses --------------------- - -Apache Software License, Version 2.0 - Apache Commons Lang - parboiled-core - parboiled-scala - -BSD - Scala License - Scala Library - -BSD License - Scala Compiler - diff --git a/community/cypher/util-3.5/pom.xml b/community/cypher/util-3.5/pom.xml deleted file mode 100644 index aea58cedf7a8e..0000000000000 --- a/community/cypher/util-3.5/pom.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - org.neo4j - cypher-parent - 3.5.0-SNAPSHOT - ../ - - - 4.0.0 - neo4j-cypher-util-3.5 - jar - 3.5.0-SNAPSHOT - Neo4j - Cypher Util 3.4 - - Cypher utilities - http://components.neo4j.org/${project.artifactId}/${project.version} - - - scm:git:git://github.com/neo4j/neo4j.git - scm:git:git@github.com:neo4j/neo4j.git - https://github.com/neo4j/neo4j - - - - notice-asl-prefix.txt - ${project.baseUri}/ASL-2-header.txt - org.neo4j.cypher.internal.util.v3_5 - - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - - - - - - - org.scalastyle - scalastyle-maven-plugin - - - - - - - - - - - - org.scala-lang - scala-library - - - - scala-reflect - org.scala-lang - - - - - - org.scalatest - scalatest_2.11 - - - org.scalacheck - scalacheck_2.11 - - - - - - org.parboiled - parboiled-scala_2.11 - - - - org.apache.commons - commons-lang3 - - - - - diff --git a/community/cypher/util-3.5/src/main/java/org/neo4j/cypher/internal/util/v3_5/AssertionRunner.java b/community/cypher/util-3.5/src/main/java/org/neo4j/cypher/internal/util/v3_5/AssertionRunner.java deleted file mode 100644 index f5fdb8db44e26..0000000000000 --- a/community/cypher/util-3.5/src/main/java/org/neo4j/cypher/internal/util/v3_5/AssertionRunner.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5; - -/* -Why is this here!? - -assert in Scala does something different to assert in Java. In Scala, it's controlled through a compiler setting, -which means you can't use the same binaries and enable/disable assertions through a JVM configuration. - -We want the Java behaviour in Scala, and this is how we achieve that. - */ -public class AssertionRunner -{ - private AssertionRunner() - { - throw new AssertionError( "No instances" ); - } - - public static void runUnderAssertion( Thunk thunk ) - { - assert runIt(thunk); - } - - private static boolean runIt( Thunk thunk ) - { - thunk.apply(); - return true; - } - - public interface Thunk - { - void apply(); - } - - public static boolean isAssertionsEnabled() - { - boolean assertionsEnabled = false; - assert assertionsEnabled = true; - return assertionsEnabled; - } -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/ASTNode.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/ASTNode.scala deleted file mode 100644 index 326cf042c6b38..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/ASTNode.scala +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -import org.neo4j.cypher.internal.util.v3_5.Rewritable._ - -trait ASTNode extends Product with Foldable with Rewritable { - - self => - - def position: InputPosition - - def dup(children: Seq[AnyRef]): this.type = - if (children.iterator eqElements this.children) - this - else { - val constructor = Rewritable.copyConstructor(this) - val params = constructor.getParameterTypes - val args = children.toVector - val hasExtraParam = params.length == args.length + 1 - val lastParamIsPos = params.last.isAssignableFrom(classOf[InputPosition]) - val ctorArgs = if (hasExtraParam && lastParamIsPos) args :+ this.position else args - val duped = constructor.invoke(this, ctorArgs: _*) - duped.asInstanceOf[self.type] - } - - def asCanonicalStringVal: String = toString -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/AssertionUtils.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/AssertionUtils.scala deleted file mode 100644 index 67b7b77ec87bd..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/AssertionUtils.scala +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -import org.neo4j.cypher.internal.util.v3_5.AssertionRunner.Thunk - -object AssertionUtils { - def ifAssertionsEnabled(f: => Unit): Unit = { - AssertionRunner.runUnderAssertion(new Thunk { - override def apply() = f - }) - } - - def assertionsEnabled = AssertionRunner.isAssertionsEnabled -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Cardinality.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Cardinality.scala deleted file mode 100644 index 88139a455102d..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Cardinality.scala +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -case class Cardinality(amount: Double) extends Ordered[Cardinality] { - - self => - - def compare(that: Cardinality) = amount.compare(that.amount) - def *(that: Multiplier): Cardinality = amount * that.coefficient - def *(that: Selectivity): Cardinality = if ( that.factor == 0 ) Cardinality.EMPTY else amount * that.factor - def +(that: Cardinality): Cardinality = amount + that.amount - def *(that: Cardinality): Cardinality = if( amount == 0 || that.amount == 0 ) Cardinality.EMPTY - else Cardinality.noInf(amount * that.amount) - def /(that: Cardinality): Option[Selectivity] = if (that.amount == 0) None else Selectivity.of(amount / that.amount) - def *(that: CostPerRow): Cost = amount * that.cost - def *(that: Cost): Cost = amount * that.gummyBears - def ^(a: Int): Cardinality = Cardinality.noInf(Math.pow(amount, a)) - def map(f: Double => Double): Cardinality = f(amount) - - def inverse = Multiplier(1.0d / amount) - - def min(other: Cardinality) = if (amount < other.amount) self else other - def max(other: Cardinality) = if (amount > other.amount) self else other -} - -object Cardinality { - - val EMPTY = Cardinality(0) - val SINGLE = Cardinality(1) - - implicit def lift(amount: Double): Cardinality = Cardinality(amount) - - private def noInf(value: Double) = if( value == Double.PositiveInfinity ) Double.MaxValue else value - - def min(l: Cardinality, r: Cardinality): Cardinality = Math.min(l.amount, r.amount) - - def max(l: Cardinality, r: Cardinality): Cardinality = Math.max(l.amount, r.amount) - - def sqrt(cardinality: Cardinality): Cardinality = Math.sqrt(cardinality.amount) - - object NumericCardinality extends Numeric[Cardinality] { - def toDouble(x: Cardinality): Double = x.amount - def toFloat(x: Cardinality): Float = x.amount.toFloat - def toInt(x: Cardinality): Int = x.amount.toInt - def toLong(x: Cardinality): Long = x.amount.toLong - def fromInt(x: Int): Cardinality = Cardinality(x) - - def negate(x: Cardinality): Cardinality = -x.amount - def plus(x: Cardinality, y: Cardinality): Cardinality = x.amount + y.amount - def times(x: Cardinality, y: Cardinality): Cardinality = x.amount * y.amount - def minus(x: Cardinality, y: Cardinality): Cardinality = x.amount - y.amount - def compare(x: Cardinality, y: Cardinality): Int = x.compare(y) - } -} - -case class Cost(gummyBears: Double) extends Ordered[Cost] { - - def +(other: Cost): Cost = other.gummyBears + gummyBears - def *(other: Multiplier): Cost = gummyBears * other.coefficient - def +(other: CostPerRow): CostPerRow = other.cost * gummyBears - def compare(that: Cost): Int = gummyBears.compare(that.gummyBears) - def unary_-(): Cost = Cost(-gummyBears) -} - -object Cost { - implicit def lift(amount: Double): Cost = Cost(amount) -} - -object CostPerRow { - implicit def lift(amount: Double): CostPerRow = CostPerRow(amount) -} - -case class CostPerRow(cost: Double) { - def +(other: CostPerRow): CostPerRow = cost + other.cost - def *(other: Multiplier): CostPerRow = cost * other.coefficient -} - -case class Multiplier(coefficient: Double) { - def +(other: Multiplier): Multiplier = other.coefficient + coefficient - def -(other: Multiplier): Multiplier = other.coefficient - coefficient - def *(other: Multiplier): Multiplier = other.coefficient * coefficient -} - -object Multiplier { - - val ZERO = Multiplier(0.0d) - val ONE = Multiplier(1.0d) - - implicit def lift(amount: Double): Multiplier = Multiplier(amount) - - def min(l: Multiplier, r: Multiplier): Multiplier = - Multiplier(Math.min(l.coefficient, r.coefficient)) - - def max(l: Multiplier, r: Multiplier): Multiplier = - Multiplier(Math.max(l.coefficient, r.coefficient)) -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/CypherException.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/CypherException.scala deleted file mode 100644 index ad80bb691d4a6..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/CypherException.scala +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -import org.neo4j.cypher.internal.util.v3_5.spi.MapToPublicExceptions - -abstract class CypherException(protected val message: String, cause: Throwable) - extends RuntimeException(message, cause) { - def this() = this(null, null) - - def this(message: String) = this(message, null) - - def this(cause: Throwable) = this(null, cause) - - def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]): T -} - -class UniquePathNotUniqueException(message: String) extends CypherException(message) { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]): T = - mapper.uniquePathNotUniqueException(message, this) -} - -class FailedIndexException(indexName: String) extends CypherException { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]) = - mapper.failedIndexException(indexName, this) -} - -class EntityNotFoundException(message: String, cause: Throwable = null) - extends CypherException(message, cause) { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]) = - mapper.entityNotFoundException(message, this) -} - -class CypherTypeException(message: String, cause: Throwable = null) - extends CypherException(message, cause) { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]) = - mapper.cypherTypeException(message, this) -} - -class ParameterNotFoundException(message: String, cause: Throwable) extends CypherException(message, cause) { - def this(message: String) = this(message, null) - - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]) = - mapper.parameterNotFoundException(message, this) -} - -class ParameterWrongTypeException(message: String, cause: Throwable = null) - extends CypherException(message, cause) { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]) = - mapper.parameterWrongTypeException(message, this) -} - -class InvalidArgumentException(message: String, cause: Throwable = null) - extends CypherException(message, cause) { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]) = - mapper.invalidArgumentException(message, this) -} - -class PatternException(message: String) extends CypherException(message) { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]) = - mapper.patternException(message, this) -} - -class InternalException(message: String, inner: Exception = null) - extends CypherException(message, inner) { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]) = - mapper.internalException(message, this) -} - -class NodeStillHasRelationshipsException(val nodeId: Long, cause: Throwable) - extends CypherException(cause) { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]) = - mapper.nodeStillHasRelationshipsException(nodeId, this) -} - -class ProfilerStatisticsNotReadyException extends CypherException { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]) = - mapper.profilerStatisticsNotReadyException(this) -} - -class IndexHintException(variable: String, label: String, properties: Seq[String], message: String) - extends CypherException(message) { - def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]) = - mapper.indexHintException(variable, label, properties, message, this) -} - -class JoinHintException(variable: String, message: String) extends CypherException(message) { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]) = - mapper.joinHintException(variable, message, this) -} - -class HintException(message: String, cause: Throwable = null) - extends CypherException(message, cause) { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]): T = - mapper.hintException(message, cause) -} - -class InvalidSemanticsException(message: String) extends CypherException(message) { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]) = - mapper.invalidSemanticException(message, this) -} - -class MergeConstraintConflictException(message: String, cause: Throwable = null) - extends CypherException(message, cause) { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]) = - mapper.mergeConstraintConflictException(message, this) -} - -class ArithmeticException(message: String, cause: Throwable = null) extends CypherException(message, cause) { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]) = - mapper.arithmeticException(message, this) -} - -class IncomparableValuesException(details: Option[String], lhs: String, rhs: String) - extends CypherException { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]) = - mapper.incomparableValuesException(details, lhs, rhs, this) - def this(operator: String, lhs: String, rhs: String) = this(Some(operator), lhs, rhs) - def this(lhs: String, rhs: String) = this(None, lhs, rhs) -} - -class UnorderableValueException(value: String) extends CypherException { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]): T = - mapper.unorderableValueException(value) -} - -class PeriodicCommitInOpenTransactionException extends CypherException { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]) = - mapper.periodicCommitInOpenTransactionException(this) -} - -class LoadExternalResourceException(message: String, cause: Throwable = null) - extends CypherException(message, cause) { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]) = - mapper.loadExternalResourceException(message, this) -} - -class LoadCsvStatusWrapCypherException(extraInfo: String, cause: CypherException) - extends CypherException(extraInfo, cause) { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]) = - // the mapper will map the cause here, so we cannot pass 'this' in as the cause... - mapper.loadCsvStatusWrapCypherException(extraInfo, cause) -} - -class SyntaxException(message: String, val query: String, val pos: Option[InputPosition]) - extends CypherException(message) { - def this(message: String, query: String, offset: InputPosition) = - this(message, query, Some(offset)) - - def this(message: String) = this(message, "", None) - - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]) = - mapper.syntaxException(message, query, pos.map(_.offset), this) -} - -class CypherExecutionException(message: String, cause: Throwable) - extends CypherException(message, cause) { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]): T = - mapper.cypherExecutionException(message, this) -} - -object ExhaustiveShortestPathForbiddenException { - val ERROR_MSG: String = - s"""Shortest path fallback has been explicitly disabled. That means that no full path enumeration is performed in - |case shortest path algorithms cannot be used. This might happen in case of existential predicates on the path, - |e.g., when searching for the shortest path containing a node with property 'name=Emil'. The problem is that - |graph algorithms work only on universal predicates, e.g., when searching for the shortest where all nodes have - |label 'Person'. In case this is an unexpected error please either disable the runtime error in the Neo4j - |configuration or please improve your query by consulting the Neo4j manual. In order to avoid planning the - |shortest path fallback a WITH clause can be introduced to separate the MATCH describing the shortest paths and - |the existential predicates on the path; note though that in this case all shortest paths are computed before - |start filtering.""".stripMargin -} - -class ExhaustiveShortestPathForbiddenException - extends CypherExecutionException(ExhaustiveShortestPathForbiddenException.ERROR_MSG, null) { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]): T = - mapper.shortestPathFallbackDisableRuntimeException(message, this) -} - -object ShortestPathCommonEndNodesForbiddenException { - val ERROR_MSG: String = - s"""The shortest path algorithm does not work when the start and end nodes are the same. This can happen if you - |perform a shortestPath search after a cartesian product that might have the same start and end nodes for some - |of the rows passed to shortestPath. If you would rather not experience this exception, and can accept the - |possibility of missing results for those rows, disable this in the Neo4j configuration by setting - |`cypher.forbid_shortestpath_common_nodes` to false. If you cannot accept missing results, and really want the - |shortestPath between two common nodes, then re-write the query using a standard Cypher variable length pattern - |expression followed by ordering by path length and limiting to one result.""".stripMargin -} - -class ShortestPathCommonEndNodesForbiddenException - extends CypherExecutionException(ShortestPathCommonEndNodesForbiddenException.ERROR_MSG, null) { - override def mapToPublic[T <: Throwable](mapper: MapToPublicExceptions[T]): T = - mapper.shortestPathCommonEndNodesForbiddenException(message, this) -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Eagerly.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Eagerly.scala deleted file mode 100644 index 71e2100b80d29..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Eagerly.scala +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -import scala.collection.{immutable, mutable} - -object Eagerly { - - def immutableReplaceKeys[K, V](m: immutable.Map[K, V])(replacements: (K, K)*): immutable.Map[K, V] = { - val deletes = replacements.map { case (oldKey, _) => oldKey } - val updates = replacements.flatMap { - case (oldKey, newKey) => m.get(oldKey).map(value => newKey -> value) - } - m -- deletes ++ updates - } - - // These two methods could in theory be replaced by a single one. My attempts so far didn't type out or broke scalac. You get a cookie if you get it to work -- boggle - - def immutableMapValues[A, B, C](m: collection.Map[A, B], f: B => C): immutable.Map[A, C] = - mapToBuilder(m, f, immutable.Map.newBuilder[A, C]) - - def mutableMapValues[A, B, C](m: collection.Map[A, B], f: B => C): mutable.Map[A, C] = - mapToBuilder(m, f, mutable.Map.newBuilder[A, C]) - - private def mapToBuilder[A, B, C, To](m: collection.Map[A, B], f: B => C, builder: mutable.Builder[(A,C ), To]): To = { - builder.sizeHint(m.size) - m.foldLeft(builder) { case (acc, (k, v)) => acc += ((k, f(v))) } - builder.result() - } -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Foldable.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Foldable.scala deleted file mode 100644 index f78fd72672dc0..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Foldable.scala +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -import scala.annotation.tailrec -import scala.collection.mutable -import scala.reflect.ClassTag - -object Foldable { - - type TreeFold[R] = PartialFunction[Any, R => (R, Option[R => R])] - - implicit class TreeAny(val that: Any) extends AnyVal { - def children: Iterator[AnyRef] = that match { - case p: Product => p.productIterator.asInstanceOf[Iterator[AnyRef]] - case s: Seq[_] => s.iterator.asInstanceOf[Iterator[AnyRef]] - case s: Set[_] => s.iterator.asInstanceOf[Iterator[AnyRef]] - case m: Map[_, _] => m.iterator.asInstanceOf[Iterator[AnyRef]] - case _ => Iterator.empty.asInstanceOf[Iterator[AnyRef]] - } - - def reverseChildren: Iterator[AnyRef] = that match { - case p: Product => reverseProductIterator(p) - case s: Seq[_] => s.reverseIterator.asInstanceOf[Iterator[AnyRef]] - case s: Set[_] => s.iterator.asInstanceOf[Iterator[AnyRef]] - case m: Map[_, _] => m.iterator.asInstanceOf[Iterator[AnyRef]] - case _ => Iterator.empty.asInstanceOf[Iterator[AnyRef]] - } - - private def reverseProductIterator(p: Product) = new Iterator[AnyRef] { - private var c: Int = p.productArity - 1 - def hasNext = c >= 0 - def next() = { val result = p.productElement(c).asInstanceOf[AnyRef]; c -= 1; result } - } - } - - implicit class FoldableAny(val that: Any) extends AnyVal { - def fold[R](init: R)(f: PartialFunction[Any, R => R]): R = - foldAcc(mutable.ArrayStack(that), init, f.lift) - - /** - * Fold of a tree structure - * - * This treefold will traverse the tree structure with a BFS strategy which can be customized as follows. - * - * The treefold behaviour is controlled by the given partial function: when the partial function is undefined on a - * given node of the tree, that node is simply ignored and the tree traversal will continue. If the partial - * function is defined on the node than it will visited in different ways, depending on the output of the function - * returned, as explained below. - * - * This function will be called with the current accumulator and it is expected to produce a pair compound of the - * next accumulator and an optional function that given an accumulator will produce a new accumulator. - * - * If the optional function is undefined then the children of the current node are skipped and not traversed. Then - * the new accumulator is used as initial value for traversing the siblings of the node. - * - * If the optional function is defined then the children are traversed and the new accumulator is used as initial - * accumulator for this "inner treefold". After this computation the function is used for creating the accumulator - * for traversing the siblings of the node by applying it to the output accumulator from the traversal of the - * children. - * - * @param init the initial value of the accumulator - * @param f partial function that given a node in the tree might return a function that takes the current - * accumulator, and return a pair compound by the new accumulator for continuing the fold and an - * optional function that takes an accumulator and returns an accumulator - * @tparam R the type of the accumulator/result - * @return the accumulated result - */ - def treeFold[R](init: R)(f: PartialFunction[Any, R => (R, Option[R => R])]): R = - treeFoldAcc( - mutable.ArrayStack(that), - init, - f.lift, - new mutable.ArrayStack[(mutable.ArrayStack[Any], R => R)](), - reverse = false - ) - - def reverseTreeFold[R](init: R)(f: PartialFunction[Any, R => (R, Option[R => R])]): R = - treeFoldAcc( - mutable.ArrayStack(that), - init, - f.lift, - new mutable.ArrayStack[(mutable.ArrayStack[Any], R => R)](), - reverse = true - ) - - /* - Allows searching through object tree and object collections - */ - def treeExists(f: PartialFunction[Any, Boolean]): Boolean = - existsAcc(mutable.ArrayStack(that), f.lift) - - /* - Allows searching through object tree and object collections - */ - def treeFind[A: ClassTag](f: PartialFunction[A, Boolean]): Option[A] = - findAcc[A](mutable.ArrayStack(that), f.lift) - - /* - Searches in trees, counting how many matches are found - */ - def treeCount(f: PartialFunction[Any, Boolean]): Int = { - countAcc(mutable.ArrayStack(that), f.lift, 0) - } - - def findByClass[A: ClassTag]: A = - findAcc[A](mutable.ArrayStack(that)) - - def findByAllClass[A: ClassTag]: Seq[A] = { - val remaining = mutable.ArrayStack(that) - var result = mutable.ListBuffer[A]() - - while (remaining.nonEmpty) { - val that = remaining.pop() - that match { - case x: A => result += x - case _ => - } - remaining ++= that.reverseChildren - } - - result - } - } - - @tailrec - private def foldAcc[R](remaining: mutable.ArrayStack[Any], acc: R, f: Any => Option[R => R]): R = - if (remaining.isEmpty) { - acc - } else { - val that = remaining.pop() - foldAcc(remaining ++= that.reverseChildren, f(that).fold(acc)(_(acc)), f) - } - - @tailrec - private def treeFoldAcc[R]( - remaining: mutable.ArrayStack[Any], - acc: R, - f: Any => Option[R => (R, Option[R => R])], - continuation: mutable.ArrayStack[(mutable.ArrayStack[Any], R => R)], - reverse: Boolean - ): R = - if (remaining.isEmpty) { - if (continuation.isEmpty) { - acc - } else { - val (stack, contAccFunc) = continuation.pop() - treeFoldAcc(stack, contAccFunc(acc), f, continuation, reverse) - } - } else { - val that = remaining.pop() - f(that) match { - case None => - val children = if (reverse) that.children else that.reverseChildren - treeFoldAcc(remaining ++= children, acc, f, continuation, reverse) - case Some(pf) => - pf(acc) match { - case (newAcc, Some(contAccFunc)) => - continuation.push((remaining, contAccFunc)) - val children = if (reverse) that.children else that.reverseChildren - treeFoldAcc(mutable.ArrayStack() ++= children, newAcc, f, continuation, reverse) - case (newAcc, None) => - treeFoldAcc(remaining, newAcc, f, continuation, reverse) - } - } - } - - @tailrec - private def existsAcc(remaining: mutable.ArrayStack[Any], f: Any => Option[Boolean]): Boolean = - if (remaining.isEmpty) { - false - } else { - val that = remaining.pop() - f(that) match { - case Some(true) => - true - case _ => - existsAcc(remaining ++= that.reverseChildren, f) - } - } - - @tailrec - private def countAcc( - remaining: mutable.ArrayStack[Any], - f: Any => Option[Boolean], - acc: Int - ): Int = - if (remaining.isEmpty) { - acc - } else { - val that = remaining.pop() - val next = f(that) match { - case Some(true) => - acc + 1 - case _ => - acc - } - - countAcc(remaining ++= that.reverseChildren, f, next) - } - - @tailrec - private def findAcc[A: ClassTag](remaining: mutable.ArrayStack[Any]): A = - if (remaining.isEmpty) { - throw new NoSuchElementException - } else { - val that = remaining.pop() - that match { - case x: A => x - case _ => findAcc(remaining ++= that.reverseChildren) - } - } - - @tailrec - private def findAcc[A: ClassTag]( - remaining: mutable.ArrayStack[Any], - predicate: A => Option[Boolean] - ): Option[A] = - if (remaining.isEmpty) { - None - } else { - val that = remaining.pop() - that match { - case x: A if predicate(x).isDefined => Some(x) - case _ => findAcc(remaining ++= that.reverseChildren, predicate) - } - } -} - -trait Foldable diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/InputPosition.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/InputPosition.scala deleted file mode 100644 index 7a0a502563ac9..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/InputPosition.scala +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -case class InputPosition(offset: Int, line: Int, column: Int) { - self => - - override def hashCode = 41 * offset - - override def equals(that: Any): Boolean = that match { - case that: InputPosition => - (that canEqual this) && offset == that.offset - case _ => - false - } - - def canEqual(that: Any): Boolean = that.isInstanceOf[InputPosition] - - override def toString = s"line $line, column $column (offset: $toOffsetString)" - - def toOffsetString = offset.toString - - def withOffset(pos: Option[InputPosition]) = pos match { - case Some(p) => - val newColumn = if (line == p.line) column + p.column - 1 else column - copy(offset + p.offset, line + p.line - 1, newColumn) - case None => self - } - - def bumped() = copy(offset = offset + 1) // HACKISH -} - -object InputPosition { - implicit val byOffset = - Ordering.by { (pos: InputPosition) => - pos.offset - } - - val NONE = InputPosition(0, 0, 0) -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/NameId.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/NameId.scala deleted file mode 100644 index c3d16d45fc15f..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/NameId.scala +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -sealed trait NameId { - def id: Int -} - -final case class LabelId(id: Int) extends NameId -final case class RelTypeId(id: Int) extends NameId -final case class PropertyKeyId(id: Int) extends NameId - -object NameId { - val WILDCARD: Int = -1 - - implicit def toKernelEncode(nameId: NameId): Int = nameId.id - implicit def toKernelEncode(nameId: Option[NameId]): Int = nameId.map(toKernelEncode).getOrElse(WILDCARD) -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/NonEmptyList.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/NonEmptyList.scala deleted file mode 100644 index 9a6504a6cc5ca..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/NonEmptyList.scala +++ /dev/null @@ -1,358 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -import scala.annotation.tailrec -import scala.collection.generic.CanBuildFrom -import scala.collection.mutable - -object NonEmptyList { - - def from[T](input: Iterable[T]): NonEmptyList[T] = - from(input.iterator) - - def from[T](input: Iterator[T]): NonEmptyList[T] = - input.asNonEmptyListOption.getOrElse( - throw new RuntimeException("Attempt to construct empty non-empty list ") - ) - - def apply[T](first: T, tail: T*): NonEmptyList[T] = - loop(Last(first), tail.iterator).reverse - - def newBuilder[T]: mutable.Builder[T, Option[NonEmptyList[T]]] = - new mutable.Builder[T, Option[NonEmptyList[T]]] { - private var vecBuilder = Vector.newBuilder[T] - - override def +=(elem: T): this.type = { - vecBuilder += elem - this - } - - override def result(): Option[NonEmptyList[T]] = { - vecBuilder.result().toNonEmptyListOption - } - - override def clear(): Unit = { - vecBuilder.clear() - } - } - - implicit def canBuildFrom[T] = new CanBuildFrom[Any, T, Option[NonEmptyList[T]]] { - def apply(from: Any) = newBuilder[T] - def apply() = newBuilder[T] - } - - implicit class IterableConverter[T](iterable: Iterable[T]) { - def toReverseNonEmptyListOption: Option[NonEmptyList[T]] = - iterable.iterator.asReverseNonEmptyListOption - - def toNonEmptyListOption: Option[NonEmptyList[T]] = - iterable.iterator.asNonEmptyListOption - - def toNonEmptyList: NonEmptyList[T] = - toNonEmptyListOption.getOrElse( - throw new InternalException("Attempt to construct empty non-empty list ") - ) - } - - implicit class VectorConverter[T](vector: Vector[T]) { - def toReverseNonEmptyListOption: Option[NonEmptyList[T]] = - vector.iterator.asReverseNonEmptyListOption - - def toNonEmptyListOption: Option[NonEmptyList[T]] = - vector.reverseIterator.asReverseNonEmptyListOption - } - - implicit class IteratorConverter[T](iterator: Iterator[T]) { - def asReverseNonEmptyListOption: Option[NonEmptyList[T]] = - if (iterator.isEmpty) None else Some(loop(Last(iterator.next()), iterator)) - - def asNonEmptyListOption: Option[NonEmptyList[T]] = - asReverseNonEmptyListOption.map(_.reverse) - } - - @tailrec - private def loop[X](acc: NonEmptyList[X], iterator: Iterator[X]): NonEmptyList[X] = - if (iterator.hasNext) loop(Fby(iterator.next(), acc), iterator) else acc -} - -// NonEmptyLists are linked lists of at least a single or multiple elements -// -// The interface follows scala collection but is not identical with it, most -// notably filter and partition have different signatures. -// -// NonEmptyLists also do not implement Traversable or Iterable directly but -// must be converted using to{Seq|Set|List|Iterable} explicitly due to -// the differing signatures. -// -sealed trait NonEmptyList[+T] { - - self => - - import NonEmptyList._ - - def head: T - - def tailOption: Option[NonEmptyList[T]] - - def hasTail: Boolean - def isLast: Boolean - - def +:[X >: T](elem: X): NonEmptyList[X] = - Fby(elem, self) - - final def :+[X >: T](elem: X): NonEmptyList[X] = - (elem +: self.reverse).reverse - - final def ++:[X >: T](iterable: Iterable[X]): NonEmptyList[X] = - self.++:(iterable.iterator) - - final def ++:[X >: T](iterator: Iterator[X]): NonEmptyList[X] = - iterator.asNonEmptyListOption match { - case Some(prefix) => prefix.reverse.mapAndPrependReversedTo[X, X](identity, self) - case None => self - } - - def ++[X >: T](other: NonEmptyList[X]): NonEmptyList[X] = - reverse.mapAndPrependReversedTo[X, X](identity, other) - - @tailrec - final def containsAnyOf[X >: T](x: X*): Boolean = self match { - case Last(elem) => x.contains(elem) - case Fby(elem, tail) => x.contains(elem) || tail.containsAnyOf(x: _*) - } - - @tailrec - final def foreach(f: T => Unit): Unit = self match { - case Last(elem) => f(elem) - case Fby(elem, tail) => f(elem); tail.foreach(f) - } - - final def filter[X >: T](f: X => Boolean): Option[NonEmptyList[T]] = - foldLeft[Option[NonEmptyList[T]]](None) { - case (None, elem) => if (f(elem)) Some(Last(elem)) else None - case (acc @ Some(nel), elem) => if (f(elem)) Some(Fby(elem, nel)) else acc - }.map(_.reverse) - - final def forall[X >: T](predicate: (X) => Boolean): Boolean = - !exists(x => !predicate(x)) - - @tailrec - final def exists[X >: T](predicate: (X) => Boolean): Boolean = self match { - case Last(elem) => predicate(elem) - case Fby(elem, _) if predicate(elem) => true - case Fby(_, tail) => tail.exists(predicate) - } - - final def map[S](f: T => S): NonEmptyList[S] = self match { - case Fby(elem, tail) => tail.mapAndPrependReversedTo[T, S](f, Last(f(elem))).reverse - case Last(elem) => Last(f(elem)) - } - - final def collect[S](pf: PartialFunction[T, S]): Option[NonEmptyList[S]] = - foldLeft(newBuilder[S]) { (builder, elem) => - if (pf.isDefinedAt(elem)) builder += pf(elem) else builder - }.result() - - @tailrec - final def mapAndPrependReversedTo[X >: T, Y](f: X => Y, acc: NonEmptyList[Y]): NonEmptyList[Y] = - self match { - case Fby(elem, tail) => tail.mapAndPrependReversedTo(f, Fby(f(elem), acc)) - case Last(elem) => Fby(f(elem), acc) - } - - final def flatMap[S](f: T => NonEmptyList[S]): NonEmptyList[S] = self match { - case Last(elem) => f(elem) - case _ => reverseFlatMap(f).reverse - } - - final def reverseFlatMap[S](f: T => NonEmptyList[S]): NonEmptyList[S] = self match { - case Fby(elem, tail) => tail.reverseFlatMapLoop(f(elem).reverse, f) - case Last(elem) => f(elem).reverse - } - - final def foldLeft[A](acc0: A)(f: (A, T) => A): A = - foldLeftLoop(acc0, f) - - final def reduceLeft[X >: T](f: (X, X) => X): X = self match { - case Fby(head, tail) => tail.reduceLeftLoop(head, f) - case Last(value) => value - } - - // Partition each element into one of two lists using f - // - // It holds that one of the two partitions must not be empty. - // This is encoded in the result type, i.e. this function - // returns - // - // - either a non empty list of As, and an option of a non empty list of Bs - // - or an option of a non empty list of As, and a non empty list of Bs - // - final def partition[A, B](f: T => Either[A, B]): Either[ - (NonEmptyList[A], Option[NonEmptyList[B]]), - (Option[NonEmptyList[A]], NonEmptyList[B]) - ] = - self match { - case Fby(elem, tail) => tail.partitionLoop(f, asPartitions(f(elem))) - case Last(elem) => asPartitions(f(elem)) - } - - final def groupBy[X >: T, K](f: X => K): Map[K, NonEmptyList[X]] = - foldLeft(Map.empty[K, NonEmptyList[X]]) { (m, value) => - val key = f(value) - val nel = m.get(key).map(cur => Fby(value, cur)).getOrElse(Last(value)) - m.updated(key, nel) - }.mapValues(_.reverse) - - final def reverse: NonEmptyList[T] = self match { - case Fby(elem, tail) => tail.mapAndPrependReversedTo[T, T](identity, Last(elem)) - case _ => self - } - - final def min[X >: T](implicit ordering: Ordering[X]): X = - reduceLeft { (left, right) => - if (ordering.compare(left, right) <= 0) left else right - } - - final def max[X >: T](implicit ordering: Ordering[X]): X = - min(ordering.reverse) - - def toIterable: Iterable[T] = new Iterable[T] { - def iterator = new Iterator[T] { - private var remaining: Option[NonEmptyList[T]] = Some(self) - - override def hasNext: Boolean = remaining.nonEmpty - - override def next(): T = remaining match { - case Some(nel) => - remaining = nel.tailOption - nel.head - case None => - throw new NoSuchElementException("next on empty iterator") - } - } - } - - def size: Int - - final def toSet[X >: T]: Set[X] = foldLeft(Set.empty[X])(_ + _) - final def toIndexedSeq: Seq[T] = foldLeft(IndexedSeq.empty[T])(_ :+ _) - - @tailrec - private def reverseFlatMapLoop[S]( - acc: NonEmptyList[S], - f: T => NonEmptyList[S] - ): NonEmptyList[S] = self match { - case Fby(elem, tail) => - tail.reverseFlatMapLoop(f(elem).mapAndPrependReversedTo[S, S](identity, acc), f) - case Last(elem) => f(elem).mapAndPrependReversedTo[S, S](identity, acc) - } - - @tailrec - private def foldLeftLoop[A, X >: T](acc0: A, f: (A, X) => A): A = self match { - case Last(head) => f(acc0, head) - case Fby(head, tail) => tail.foldLeftLoop(f(acc0, head), f) - } - - @tailrec - private def reduceLeftLoop[X >: T](acc: X, f: (X, X) => X): X = self match { - case Fby(elem, tail) => tail.reduceLeftLoop(f(acc, elem), f) - case Last(elem) => f(acc, elem) - } - - private def asPartitions[A, B](item: Either[A, B]): Either[ - (NonEmptyList[A], Option[NonEmptyList[B]]), - (Option[NonEmptyList[A]], NonEmptyList[B]) - ] = - item match { - case Left(l) => Left((NonEmptyList(l), None)) - case Right(r) => Right((None, NonEmptyList(r))) - } - - @tailrec - private def partitionLoop[A, B]( - f: T => Either[A, B], - acc: Either[ - (NonEmptyList[A], Option[NonEmptyList[B]]), - (Option[NonEmptyList[A]], NonEmptyList[B]) - ] - ): Either[ - (NonEmptyList[A], Option[NonEmptyList[B]]), - (Option[NonEmptyList[A]], NonEmptyList[B]) - ] = - self match { - case Fby(elem, tail) => tail.partitionLoop(f, appendToPartitions(f(elem), acc)) - case Last(elem) => reversePartitions(appendToPartitions(f(elem), acc)) - } - - private def appendToPartitions[A, B]( - value: Either[A, B], - acc: Either[ - (NonEmptyList[A], Option[NonEmptyList[B]]), - (Option[NonEmptyList[A]], NonEmptyList[B]) - ] - ): Either[ - (NonEmptyList[A], Option[NonEmptyList[B]]), - (Option[NonEmptyList[A]], NonEmptyList[B]) - ] = - (value, acc) match { - case (Left(elem), Left((lefts, optRights))) => Left((Fby(elem, lefts), optRights)) - case (Left(elem), Right((optLefts, rights))) => - Right((prependToOptionalNonEmptyList(elem, optLefts), rights)) - case (Right(elem), Left((lefts, optRights))) => - Left((lefts, prependToOptionalNonEmptyList(elem, optRights))) - case (Right(elem), Right((optLefts, rights))) => Right((optLefts, Fby(elem, rights))) - } - - private def reversePartitions[A, B]( - acc: Either[ - (NonEmptyList[A], Option[NonEmptyList[B]]), - (Option[NonEmptyList[A]], NonEmptyList[B]) - ] - ): Either[ - (NonEmptyList[A], Option[NonEmptyList[B]]), - (Option[NonEmptyList[A]], NonEmptyList[B]) - ] = - acc match { - case Left((lefts, optRights)) => Left((lefts.reverse, optRights.map(_.reverse))) - case Right((optLefts, rights)) => Right((optLefts.map(_.reverse), rights.reverse)) - } - - private def prependToOptionalNonEmptyList[X]( - elem: X, - optNel: Option[NonEmptyList[X]] - ): Option[NonEmptyList[X]] = - optNel.map { nel => - Fby(elem, nel) - } orElse Some(Last(elem)) -} - -final case class Fby[+T](head: T, tail: NonEmptyList[T]) extends NonEmptyList[T] { - override def tailOption: Option[NonEmptyList[T]] = Some(tail) - override def hasTail: Boolean = true - override def isLast: Boolean = false - override def toString = s"${head.toString}, ${tail.toString}" - override def size = 1 + tail.size -} - -final case class Last[+T](head: T) extends NonEmptyList[T] { - override def tailOption: Option[NonEmptyList[T]] = None - override def hasTail: Boolean = false - override def isLast: Boolean = true - override def toString = s"${head.toString}" - override def size = 1 -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/PrefixNameGenerator.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/PrefixNameGenerator.scala deleted file mode 100644 index 0ca6ed450e647..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/PrefixNameGenerator.scala +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -object FreshIdNameGenerator extends PrefixNameGenerator("FRESHID") - -object AggregationNameGenerator extends PrefixNameGenerator("AGGREGATION") - -object NodeNameGenerator extends PrefixNameGenerator("NODE") - -object RelNameGenerator extends PrefixNameGenerator("REL") - -object UnNamedNameGenerator extends PrefixNameGenerator("UNNAMED") { - implicit class NameString(name: String) { - def isNamed = UnNamedNameGenerator.isNamed(name) - def unnamed = UnNamedNameGenerator.notNamed(name) - } -} - -object PrefixNameGenerator { - def namePrefix(prefix: String) = s" $prefix" -} - -case class PrefixNameGenerator(generatorName: String) { - val prefix = s" $generatorName" - - def name(position: InputPosition): String = s"$prefix${position.toOffsetString}" - - def isNamed(x: String) = !notNamed(x) - def notNamed(x: String) = x.startsWith(prefix) -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Ref.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Ref.scala deleted file mode 100644 index 735286f5e1fa0..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Ref.scala +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -object Ref { - def apply[T <: AnyRef](v: T) = new Ref[T](v) -} - -final class Ref[+T <: AnyRef](val value: T) { - if (value == null) - throw new InternalException("Attempt to instantiate Ref(null)") - - def toIdString = Integer.toHexString(java.lang.System.identityHashCode(value)) - - override def toString = s"Ref@$toIdString($value)" - - override def hashCode = java.lang.System.identityHashCode(value) - - override def equals(that: Any) = that match { - case other: Ref[_] => value eq other.value - case _ => false - } -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Rewritable.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Rewritable.scala deleted file mode 100644 index d2e163961af27..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Rewritable.scala +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -import java.lang.reflect.Method - -import org.neo4j.cypher.internal.util.v3_5.Foldable._ -import org.neo4j.cypher.internal.util.v3_5.Rewritable._ - -import scala.annotation.tailrec -import scala.collection.mutable -import scala.collection.mutable.{HashMap => MutableHashMap} - -object Rewriter { - def lift(f: PartialFunction[AnyRef, AnyRef]): Rewriter = - f.orElse(PartialFunction(identity[AnyRef])) - - val noop: Rewriter = Rewriter.lift(PartialFunction.empty) -} - -object RewriterWithArgs { - def lift(f: PartialFunction[(AnyRef, Seq[AnyRef]), AnyRef]): RewriterWithArgs = - f.orElse(PartialFunction({ - // We need to dup anything not matched by f given the children - case (p: Product, children) => Rewritable.dupProduct(p, children).asInstanceOf[AnyRef] - case (a: AnyRef, children) => Rewritable.dupAny(a, children) - case (null, _) => null - })) -} - -object Rewritable { - implicit class IteratorEq[A <: AnyRef](val iterator: Iterator[A]) { - def eqElements[B <: AnyRef](that: Iterator[B]): Boolean = { - while (iterator.hasNext && that.hasNext) { - if (!(iterator.next eq that.next)) - return false - } - !iterator.hasNext && !that.hasNext - } - } - - private val productCopyConstructors = new ThreadLocal[MutableHashMap[Class[_], Method]]() { - override def initialValue: MutableHashMap[Class[_], Method] = - new MutableHashMap[Class[_], Method] - } - - def copyConstructor(product: Product): Method = { - def getCopyMethod(productClass: Class[_ <: Product]): Method = { - try { - productClass.getMethods.find(_.getName == "copy").get - } catch { - case e: NoSuchElementException => - throw new InternalException( - s"Failed trying to rewrite $productClass - this class does not have a `copy` method" - ) - } - } - - val productClass = product.getClass - productCopyConstructors.get.getOrElseUpdate(productClass, getCopyMethod(productClass)) - } - - def dupAny(that: AnyRef, children: Seq[AnyRef]): AnyRef = - try { - if (children.iterator eqElements that.children) { - that - } else { - that match { - case a: Rewritable => - a.dup(children) - case p: Product => - copyConstructor(p).invoke(p, children: _*) - case _: IndexedSeq[_] => - children.toIndexedSeq - case _: Seq[_] => - children - case _: Set[_] => - children.toSet - case _: Map[_, _] => - children.map(value => value.asInstanceOf[(String, AnyRef)]).toMap - case t => - t - } - } - } catch { - case e: IllegalArgumentException => - throw new InternalException(s"Failed rewriting $that\nTried using children: $children", e) - } - - def dupProduct(product: Product, children: Seq[AnyRef]): Product = product match { - case a: Rewritable => - a.dup(children) - case _ => - if (children.iterator eqElements product.children) - product - else - copyConstructor(product).invoke(product, children: _*).asInstanceOf[Product] - } - - implicit class RewritableAny[T <: AnyRef](val that: T) extends AnyVal { - def rewrite(rewriter: Rewriter): AnyRef = { - val result = rewriter.apply(that) - result - } - - def rewrite(rewriter: RewriterWithArgs, args: Seq[AnyRef]): AnyRef = { - val result = rewriter.apply((that, args)) - result - } - - def endoRewrite(rewriter: Rewriter): T = rewrite(rewriter).asInstanceOf[T] - } -} - -case class TypedRewriter[T <: Rewritable](rewriter: Rewriter) extends (T => T) { - def apply(that: T) = rewriter.apply(that).asInstanceOf[T] - - def narrowed[S <: T] = TypedRewriter[S](rewriter) -} - -trait Rewritable { - def dup(children: Seq[AnyRef]): this.type -} - -object inSequence { - private class InSequenceRewriter(rewriters: Seq[Rewriter]) extends Rewriter { - override def apply(that: AnyRef): AnyRef = { - val it = rewriters.iterator - //this piece of code is used a lot and has been through profiling - //please don't just remove it because it is ugly looking - var result = that - while (it.hasNext) { - result = result.rewrite(it.next()) - } - - result - } - } - - def apply(rewriters: Rewriter*): Rewriter = new InSequenceRewriter(rewriters) -} - -object topDown { - private class TopDownRewriter(rewriter: Rewriter, val stopper: AnyRef => Boolean) - extends Rewriter { - override def apply(that: AnyRef): AnyRef = { - val initialStack = mutable.ArrayStack((List(that), new mutable.MutableList[AnyRef]())) - val result = rec(initialStack) - assert(result.size == 1) - result.head - } - - @tailrec - private def rec(stack: mutable.ArrayStack[(List[AnyRef], mutable.MutableList[AnyRef])]): mutable.MutableList[AnyRef] = { - val (currentJobs, _) = stack.top - if (currentJobs.isEmpty) { - val (_, newChildren) = stack.pop() - if (stack.isEmpty) { - newChildren - } else { - val (job :: jobs, doneJobs) = stack.pop() - val doneJob = Rewritable.dupAny(job, newChildren) - stack.push((jobs, doneJobs += doneJob)) - rec(stack) - } - } else { - val (newJob :: jobs, doneJobs) = stack.pop() - if (stopper(newJob)) { - stack.push((jobs, doneJobs += newJob)) - } else { - val rewrittenJob = newJob.rewrite(rewriter) - stack.push((rewrittenJob :: jobs, doneJobs)) - stack.push((rewrittenJob.children.toList, new mutable.MutableList())) - } - rec(stack) - } - } - } - - def apply(rewriter: Rewriter, stopper: (AnyRef) => Boolean = _ => false): Rewriter = - new TopDownRewriter(rewriter, stopper) -} - -object bottomUp { - - private class BottomUpRewriter(val rewriter: Rewriter, val stopper: AnyRef => Boolean) - extends Rewriter { - override def apply(that: AnyRef): AnyRef = { - val initialStack = mutable.ArrayStack((List(that), new mutable.MutableList[AnyRef]())) - val result = rec(initialStack) - assert(result.size == 1) - result.head - } - - @tailrec - private def rec(stack: mutable.ArrayStack[(List[AnyRef], mutable.MutableList[AnyRef])]): mutable.MutableList[AnyRef] = { - val (currentJobs, _) = stack.top - if (currentJobs.isEmpty) { - val (_, newChildren) = stack.pop() - if (stack.isEmpty) { - newChildren - } else { - val (job :: jobs, doneJobs) = stack.pop() - val doneJob = Rewritable.dupAny(job, newChildren) - val rewrittenDoneJob = doneJob.rewrite(rewriter) - stack.push((jobs, doneJobs += rewrittenDoneJob)) - rec(stack) - } - } else { - val next = currentJobs.head - if (stopper(next)) { - val (job :: jobs, doneJobs) = stack.pop() - stack.push((jobs, doneJobs += job)) - } else { - stack.push((next.children.toList, new mutable.MutableList())) - } - rec(stack) - } - } - } - - def apply(rewriter: Rewriter, stopper: (AnyRef) => Boolean = _ => false): Rewriter = - new BottomUpRewriter(rewriter, stopper) -} - -object bottomUpWithArgs { - - private class BottomUpWithArgsRewriter(val rewriter: RewriterWithArgs, val stopper: AnyRef => Boolean) - extends RewriterWithArgs { - override def apply(tuple: (AnyRef, Seq[AnyRef])): AnyRef = { - val (that: AnyRef, _) = tuple - val initialStack = mutable.ArrayStack((List(that), new mutable.MutableList[AnyRef]())) - val result = rec(initialStack) - assert(result.size == 1) - result.head - } - - @tailrec - private def rec(stack: mutable.ArrayStack[(List[AnyRef], mutable.MutableList[AnyRef])]): mutable.MutableList[AnyRef] = { - val (currentJobs, _) = stack.top - if (currentJobs.isEmpty) { - val (_, newChildren) = stack.pop() - if (stack.isEmpty) { - newChildren - } else { - val (job :: jobs, doneJobs) = stack.pop() - val doneJob = job.rewrite(rewriter, newChildren) - stack.push((jobs, doneJobs += doneJob)) - rec(stack) - } - } else { - val next = currentJobs.head - if (stopper(next)) { - val (job :: jobs, doneJobs) = stack.pop() - stack.push((jobs, doneJobs += job)) - } else { - stack.push((next.children.toList, new mutable.MutableList())) - } - rec(stack) - } - } - } - - def apply(rewriter: RewriterWithArgs, stopper: (AnyRef) => Boolean = _ => false): RewriterWithArgs = - new BottomUpWithArgsRewriter(rewriter, stopper) -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Selectivity.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Selectivity.scala deleted file mode 100644 index c6a7c9f9e23ca..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Selectivity.scala +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -case class Selectivity private(factor: Double) extends Ordered[Selectivity] { - assert(factor >= 0 && factor <= 1.0) - def *(other: Selectivity): Selectivity = Selectivity(other.factor * factor) - def ^(a: Int): Selectivity = Selectivity(Math.pow(factor, a)) - def negate: Selectivity = { - val f = 1.0 - factor - if (factor == 0 || f < 1) - Selectivity(f) - else - Selectivity.CLOSEST_TO_ONE - } - - def compare(that: Selectivity) = factor.compare(that.factor) -} - -object Selectivity { - - def of(value: Double): Option[Selectivity] = if (value.isInfinite || value.isNaN || value < 0.0 || value > 1.0) None else Some(Selectivity(value)) - - val ZERO = Selectivity(0.0d) - val ONE = Selectivity(1.0d) - val CLOSEST_TO_ONE = Selectivity(1 - 5.56e-17) // we can get closer, but this is close enough - - - implicit def turnSeqIntoSingleSelectivity(p: Seq[Selectivity]): Selectivity = - p.reduceOption(_ * _).getOrElse(Selectivity(1)) -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/TaskCloser.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/TaskCloser.scala deleted file mode 100644 index b4f30506f3eb5..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/TaskCloser.scala +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -import scala.collection.mutable.ArrayBuffer - -class TaskCloser { - - private val _tasks: ArrayBuffer[Boolean => Unit] = ArrayBuffer.empty - private var closed = false - - /** - * - * @param task This task will be called, with true if the query went OK, and a false if an error occurred - */ - def addTask(task: Boolean => Unit) { - if(closed) - throw new IllegalStateException("Already closed") - _tasks += task - } - - def close(success: Boolean) { - if (!closed) { - closed = true - var foundException: Option[Throwable] = None - _tasks.reverse foreach { - f => - try { - f(success) - } catch { - case e: Throwable => - foundException match { - case Some(first) => first.addSuppressed(e) - case None => foundException = Some(e) - } - } - } - - foundException.forall(throwable => throw throwable) - } - } - - def isClosed: Boolean = closed -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Unchangeable.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Unchangeable.scala deleted file mode 100644 index b35973d16f565..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/Unchangeable.scala +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -// Freely after the ATOM idea presented by Daniel Spiewak (@djspiewak) in -// the video "Functional Compilers: From CFG to EXE" -// This is a wrapper that allows values to be set multiple times, but can be trusted to never change once seen. -class Unchangeable[A]() { - private var _seen = false - private var _value: Option[A] = None - - def hasValue: Boolean = _value.isDefined - - // Getter - def value: A = { - val result = _value.getOrElse(throw new InternalException("Value still not set")) - _seen = true - result - } - - // Setter - def value_=(newValue: A): Unit = { - if (_seen) throw new InternalException("Can't change a seen value") - _value = Some(newValue) - } - - // Copy from another Unchangeable[A] iff set - def copyFrom(other: Unchangeable[A]) = if(other.hasValue) - value_=(other.value) - - override def toString: String = s"Unchangeable(${_value.getOrElse("NOT SET")})" -} \ No newline at end of file diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/ZeroOneOrMany.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/ZeroOneOrMany.scala deleted file mode 100644 index 4c2d3bec9db7e..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/ZeroOneOrMany.scala +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -sealed trait ZeroOneOrMany[+T] - -object ZeroOneOrMany { - def apply[T](elts: Seq[T]): ZeroOneOrMany[T] = elts match { - case Seq() => Zero - case Seq(one) => One(one) - case many => Many(many) - } -} - -case object Zero extends ZeroOneOrMany[Nothing] -final case class One[T](value: T) extends ZeroOneOrMany[T] -final case class Many[T](values: Seq[T]) extends ZeroOneOrMany[T] diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/attribution/Attribute.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/attribution/Attribute.scala deleted file mode 100644 index d2d870658048d..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/attribution/Attribute.scala +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.attribution - -import org.neo4j.cypher.internal.util.v3_5.Unchangeable - -import scala.collection.mutable.ArrayBuffer - -trait Attribute[T] { - - private val array: ArrayBuffer[Unchangeable[T]] = new ArrayBuffer[Unchangeable[T]]() - - def set(id: Id, t: T): Unit = { - val requiredSize = id.x + 1 - if (array.size < requiredSize) - resizeArray(requiredSize) - array(id.x).value = t - } - - def get(id: Id): T = { - array(id.x).value - } - - def isDefinedAt(id: Id): Boolean = { - array.size > id.x && array(id.x).hasValue - } - - def getOrElse(id: Id, other: => T): T = { - if (isDefinedAt(id)) get(id) else other - } - - def iterator: Iterator[(Id, T)] = new Iterator[(Id, T)]() { - private var currentId = -1 - private var nextTup: (Id, T) = _ - - private def fetchNext(): Unit = { - nextTup = null - while (nextTup == null && - {currentId = currentId + 1; currentId} < array.size) { - val c = array(currentId) - if (c.hasValue) { - nextTup = (Id(currentId), c.value) - } - } - } - - override def hasNext = { - if (currentId >= array.size) - false - else { - if (nextTup == null) { - fetchNext() - } - nextTup != null - } - } - - override def next() = { - if (hasNext) { - val res = nextTup - nextTup = null - res - } else { - throw new NoSuchElementException - } - } - } - - def size = iterator.size - - def apply(id: Id): T = get(id) - - def copy(from:Id, to:Id): Unit = { - if(isDefinedAt(from)) - set(to, get(from)) - } - - def mapTo[U](otherAttribute: Attribute[U], f: T => U): Unit = { - var i = 0 - while(i < array.size) { - val id = Id(i) - if(isDefinedAt(id)) { - otherAttribute.set(id, f(this.get(id))) - } - i = i + 1 - } - } - - override def toString(): String = { - val sb = new StringBuilder - sb ++= this.getClass.getSimpleName + "\n" - for (i <- array.indices) - sb ++= s"$i : ${array(i)}\n" - sb.result() - } - - private def resizeArray(requiredSize: Int): Unit = { - while (array.size < requiredSize) - array += new Unchangeable - } -} - -/** - * This class encapsulates attributes and allows to copy them from one ID to another without having explicit - * read or write access. This allows rewriters to set some attributes manually on a new ID, but copying - * others over from an old id. - * @param idGen the IdGen used to provide new IDs - * @param attributes the attributes encapsulated - */ -case class Attributes(idGen: IdGen, private val attributes: Attribute[_]*) { - def copy(from: Id): IdGen = new IdGen { - override def id(): Id = { - val to = idGen.id() - for (a <- attributes) { - a.copy(from, to) - } - to - } - } - - def withAlso(attributes: Attribute[_]*) : Attributes = { - Attributes(this.idGen, this.attributes ++ attributes: _*) - } -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/attribution/Ids.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/attribution/Ids.scala deleted file mode 100644 index e208ac0ca3bb4..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/attribution/Ids.scala +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.attribution - -case class Id(x: Int) extends AnyVal - -object Id { - val INVALID_ID: Id = Id(-1) -} - -trait IdGen { - def id(): Id -} - -class SequentialIdGen(initialValue: Int = 0) extends IdGen { - private var i: Int = initialValue - - def id(): Id = { - val id = Id(i) - i += 1 - id - } -} - -case class SameId(id: Id) extends IdGen - diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/package.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/package.scala deleted file mode 100644 index 077f0ff27becc..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/package.scala +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util - -package object v3_5 { - type Rewriter = (AnyRef => AnyRef) - type RewriterWithArgs = (((AnyRef, Seq[AnyRef])) => AnyRef) -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/spi/MapToPublicExceptions.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/spi/MapToPublicExceptions.scala deleted file mode 100644 index 1be16be2b8b6e..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/spi/MapToPublicExceptions.scala +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.spi - -import org.neo4j.cypher.internal.util.v3_5.CypherException - -trait MapToPublicExceptions[T <: Throwable] { - def failedIndexException(indexName: String, cause: Throwable): T - - def periodicCommitInOpenTransactionException(cause: Throwable): T - - def syntaxException(message: String, query: String, offset: Option[Int], cause: Throwable): T - - def loadCsvStatusWrapCypherException(extraInfo: String, cause: CypherException): T - - def loadExternalResourceException(message: String, cause: Throwable): T - - def unorderableValueException(value: String): T - - def incomparableValuesException( - operator: Option[String], - lhs: String, - rhs: String, - cause: Throwable - ): T - - def arithmeticException(message: String, cause: Throwable): T - - def mergeConstraintConflictException(message: String, cause: Throwable): T - - def invalidSemanticException(message: String, cause: Throwable): T - - def indexHintException( - variable: String, - label: String, - properties: Seq[String], - message: String, - cause: Throwable - ): T - - def hintException(message: String, cause: Throwable): T - - def joinHintException(variable: String, message: String, cause: Throwable): T - - def profilerStatisticsNotReadyException(cause: Throwable): T - - def nodeStillHasRelationshipsException(nodeId: Long, cause: Throwable): T - - def internalException(message: String, cause: Exception): T - - def patternException(message: String, cause: Throwable): T - - def invalidArgumentException(message: String, cause: Throwable): T - - def parameterWrongTypeException(message: String, cause: Throwable): T - - def parameterNotFoundException(message: String, cause: Throwable): T - - def uniquePathNotUniqueException(message: String, cause: Throwable): T - - def entityNotFoundException(message: String, cause: Throwable): T - - def cypherTypeException(message: String, cause: Throwable): T - - def cypherExecutionException(message: String, cause: Throwable): T - - def shortestPathFallbackDisableRuntimeException(message: String, cause: Throwable): T - - def shortestPathCommonEndNodesForbiddenException(message: String, cause: Throwable): T - -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/AnyType.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/AnyType.scala deleted file mode 100644 index 06d4f33969367..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/AnyType.scala +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.symbols - -object AnyType { - val instance = new AnyType() { - val parentType = this - override val isAbstract = true - - override def isAssignableFrom(other: CypherType): Boolean = true - - override val toString = "Any" - override val toNeoTypeString = "ANY?" - } -} - -sealed abstract class AnyType extends CypherType diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/BooleanType.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/BooleanType.scala deleted file mode 100644 index e969c59784e6d..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/BooleanType.scala +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.symbols - -object BooleanType { - val instance = new BooleanType() { - val parentType = CTAny - override val toString = "Boolean" - override val toNeoTypeString = "BOOLEAN?" - } -} - -sealed abstract class BooleanType extends CypherType diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/CypherType.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/CypherType.scala deleted file mode 100644 index 610f26eb61bcf..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/CypherType.scala +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.symbols - -abstract class CypherType { - def parentType: CypherType - val isAbstract: Boolean = false - - def coercibleTo: Set[CypherType] = Set.empty - - def parents: Seq[CypherType] = parents(Vector.empty) - private def parents(accumulator: Seq[CypherType]): Seq[CypherType] = - if (this.parentType == this) - accumulator - else - this.parentType.parents(accumulator :+ this.parentType) - - /* - Determines if the class or interface represented by this - {@code CypherType} object is either the same as, or is a - supertype of, the class or interface represented by the - specified {@code CypherType} parameter. - */ - def isAssignableFrom(other: CypherType): Boolean = - if (other == this) - true - else if (other.parentType == other) - false - else - isAssignableFrom(other.parentType) - - def legacyIteratedType: CypherType = this - - def leastUpperBound(other: CypherType): CypherType = - if (this.isAssignableFrom(other)) this - else if (other.isAssignableFrom(this)) other - else parentType leastUpperBound other.parentType - - def greatestLowerBound(other: CypherType): Option[CypherType] = - if (this.isAssignableFrom(other)) Some(other) - else if (other.isAssignableFrom(this)) Some(this) - else None - - lazy val covariant: TypeSpec = TypeSpec.all constrain this - lazy val invariant: TypeSpec = TypeSpec.exact(this) - lazy val contravariant: TypeSpec = TypeSpec.all leastUpperBounds this - - def rewrite(f: CypherType => CypherType) = f(this) - - def toNeoTypeString: String -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/FloatType.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/FloatType.scala deleted file mode 100644 index 62555607f8f9b..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/FloatType.scala +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.symbols - -object FloatType { - val instance = new FloatType() { - val parentType = CTNumber - override val toString = "Float" - override val toNeoTypeString = "FLOAT?" - } -} - -sealed abstract class FloatType extends CypherType diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/GeometryType.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/GeometryType.scala deleted file mode 100644 index 8b9f134872306..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/GeometryType.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.symbols - -object GeometryType { - val instance = new GeometryType() { - val parentType = CTAny - override val toString = "Geometry" - - override def toNeoTypeString = "GEOMETRY?" - } -} - -sealed abstract class GeometryType extends CypherType diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/GraphRefType.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/GraphRefType.scala deleted file mode 100644 index 5c06c22bf5164..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/GraphRefType.scala +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.symbols - -object GraphRefType { - val instance = new GraphRefType() { - override val parentType = CTAny - override val toString = "GraphRef" - override val toNeoTypeString = "GRAPHREF?" - } -} - -sealed trait GraphRefType extends CypherType diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/IntegerType.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/IntegerType.scala deleted file mode 100644 index b89f60ab3d99e..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/IntegerType.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.symbols - -object IntegerType { - val instance = new IntegerType() { - val parentType = CTNumber - override lazy val coercibleTo: Set[CypherType] = Set(CTFloat) ++ parentType.coercibleTo - override val toString = "Integer" - override val toNeoTypeString = "INTEGER?" - } -} - -sealed abstract class IntegerType extends CypherType diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/ListType.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/ListType.scala deleted file mode 100644 index cebc777cc1397..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/ListType.scala +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.symbols - -object ListType { - private val anyCollectionTypeInstance = new ListTypeImpl(CTAny) - - def apply(iteratedType: CypherType) = - if (iteratedType == CTAny) anyCollectionTypeInstance else new ListTypeImpl(iteratedType) - - final case class ListTypeImpl(innerType: CypherType) extends ListType { - val parentType = CTAny - override val legacyIteratedType = innerType - - override lazy val coercibleTo: Set[CypherType] = Set(CTBoolean) ++ parentType.coercibleTo - - override def parents = innerType.parents.map(copy) ++ super.parents - - override val toString = s"List<$innerType>" - override val toNeoTypeString = s"LIST? OF ${innerType.toNeoTypeString}" - - override def isAssignableFrom(other: CypherType): Boolean = other match { - case otherCollection: ListType => - innerType isAssignableFrom otherCollection.innerType - case _ => - super.isAssignableFrom(other) - } - - override def leastUpperBound(other: CypherType) = other match { - case otherCollection: ListType => - copy(innerType leastUpperBound otherCollection.innerType) - case _ => - super.leastUpperBound(other) - } - - override def greatestLowerBound(other: CypherType) = other match { - case otherCollection: ListType => - (innerType greatestLowerBound otherCollection.innerType).map(copy) - case _ => - super.greatestLowerBound(other) - } - - override def rewrite(f: CypherType => CypherType) = f(copy(innerType.rewrite(f))) - } - - def unapply(x: CypherType): Option[CypherType] = x match { - case x: ListType => Some(x.innerType) - case _ => None - } -} - -sealed abstract class ListType extends CypherType { - def innerType: CypherType -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/MapType.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/MapType.scala deleted file mode 100644 index 53dda5c73c93f..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/MapType.scala +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.symbols - -object MapType { - val instance = new MapType() { - val parentType = CTAny - override val toString = "Map" - override val toNeoTypeString = "MAP?" - } -} - -sealed abstract class MapType extends CypherType diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/NodeType.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/NodeType.scala deleted file mode 100644 index 1764657711476..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/NodeType.scala +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.symbols - -object NodeType { - val instance = new NodeType() { - val parentType = CTMap - override val toString = "Node" - override val toNeoTypeString = "NODE?" - } -} - -sealed abstract class NodeType extends CypherType diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/NumberType.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/NumberType.scala deleted file mode 100644 index 6c359a2577b20..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/NumberType.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.symbols - -object NumberType { - val instance = new NumberType() { - val parentType = CTAny - override val isAbstract = true - override val toString = "Number" - override val toNeoTypeString = "NUMBER?" - } -} - -sealed abstract class NumberType extends CypherType diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/PathType.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/PathType.scala deleted file mode 100644 index f53966df2433a..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/PathType.scala +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.symbols - -object PathType { - val instance = new PathType() { - val parentType = CTAny - override val toString = "Path" - override val toNeoTypeString = "PATH?" - } -} - -sealed abstract class PathType extends CypherType diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/PointType.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/PointType.scala deleted file mode 100644 index 80f79e4befd76..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/PointType.scala +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.symbols - -object PointType { - val instance = new PointType() { - val parentType = CTAny - override val toString = "Point" - override val toNeoTypeString = "POINT?" - } -} - -sealed abstract class PointType extends CypherType diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/RelationshipType.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/RelationshipType.scala deleted file mode 100644 index b2935def44127..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/RelationshipType.scala +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.symbols - -object RelationshipType { - val instance = new RelationshipType() { - val parentType = CTMap - override val toString = "Relationship" - override val toNeoTypeString = "RELATIONSHIP?" - } -} - -sealed abstract class RelationshipType extends CypherType diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/StringType.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/StringType.scala deleted file mode 100644 index 117dce00547e4..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/StringType.scala +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.symbols - -object StringType { - val instance = new StringType() { - val parentType = CTAny - override val toString = "String" - override val toNeoTypeString = "STRING?" - } -} - -sealed trait StringType extends CypherType diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/TemporalTypes.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/TemporalTypes.scala deleted file mode 100644 index 0c2370f13f675..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/TemporalTypes.scala +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.symbols - -object TemporalTypes { - val datetime = new DateTimeType { - val parentType = CTAny - override val toString = "DateTime" - override val toNeoTypeString = "DATETIME?" - } - val localdatetime = new LocalDateTimeType { - val parentType = CTAny - override val toString = "LocalDateTime" - override val toNeoTypeString = "LOCALDATETIME?" - } - val date = new DateType { - val parentType = CTAny - override val toString = "Date" - override val toNeoTypeString = "DATE?" - } - val time = new TimeType { - val parentType = CTAny - override val toString = "Time" - override val toNeoTypeString = "TIME?" - } - val localtime = new LocalTimeType { - val parentType = CTAny - override val toString = "LocalTime" - override val toNeoTypeString = "LOCALTIME?" - } - val duration = new DurationType { - val parentType = CTAny - override val toString = "Duration" - override val toNeoTypeString = "DURATION?" - } -} - -sealed abstract class DateTimeType extends CypherType -sealed abstract class LocalDateTimeType extends CypherType -sealed abstract class DateType extends CypherType -sealed abstract class TimeType extends CypherType -sealed abstract class LocalTimeType extends CypherType -sealed abstract class DurationType extends CypherType diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/TypeRange.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/TypeRange.scala deleted file mode 100644 index fb527c90364d0..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/TypeRange.scala +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.symbols - -object TypeRange { - def apply(lower: CypherType, upper: CypherType): TypeRange = TypeRange(lower, Some(upper)) -} - -/** - * A TypeRange represents a path through the type tree, or an entire branch. - * E.g. (CTAny)<-[*]-(CTInteger), or (CTNumber)<-[*]-() - * - * @param lower The root of the path or the branch - * @param upper Some(type), if the TypeRange is a path through the type tree, or None, if the TypeRange is an entire branch - */ -case class TypeRange(lower: CypherType, upper: Option[CypherType]) { - assert(upper.isEmpty || (lower isAssignableFrom upper.get), "Incompatible TypeRange bounds") - - def contains(aType: CypherType): Boolean = - (lower isAssignableFrom aType) && upper.fold(true)(aType isAssignableFrom) - - def contains(that: TypeRange): Boolean = - (lower isAssignableFrom that.lower) && upper.fold(true)( - t => that.upper.fold(false)(_ isAssignableFrom t) - ) - - lazy val hasDefiniteSize: Boolean = upper.isDefined || !checkForAny(lower) - private def checkForAny: CypherType => Boolean = { - case _: AnyType => true - case c: ListType => checkForAny(c.innerType) - case _ => false - } - - def &(that: TypeRange): Option[TypeRange] = this intersect that - def intersect(that: TypeRange): Option[TypeRange] = - (lower greatestLowerBound that.lower).flatMap { newLower => - val newUpper = upper.fold(that.upper)(t => Some(that.upper.fold(t)(_ leastUpperBound t))) - if (newUpper.isDefined && !(newLower isAssignableFrom newUpper.get)) - None - else - Some(TypeRange(newLower, newUpper)) - } - - def covariant: TypeRange = copy(upper = None) - - def constrain(aType: CypherType): Option[TypeRange] = this & TypeRange(aType, None) - - def without(aType: CypherType): Option[TypeRange] = { - if (aType.isAssignableFrom(lower)) { - None - } else if (lower.isAssignableFrom(aType)) { - upper match { - case None => Some(TypeRange(lower, aType.parentType)) - case Some(up) => - if (aType.isAssignableFrom(up)) - Some(TypeRange(lower, aType.parentType)) - else - Some(this) - } - } else { - Some(this) - } - } - - /** - * @param other the other range to determine LUBs in combination with - * @return a set of TypeRanges that cover the LUBs for all combinations of individual types between both TypeRanges - */ - def leastUpperBounds(other: TypeRange): Seq[TypeRange] = { - val newLower = lower leastUpperBound other.lower - (upper, other.upper) match { - case (Some(u1), Some(u2)) => - Vector(TypeRange(newLower, Some(u1 leastUpperBound u2))) - case (Some(u1), None) => - if ((u1 isAssignableFrom other.lower) || (other.lower isAssignableFrom u1)) - Vector(TypeRange(newLower, Some(u1))) - else - Vector(TypeRange(newLower, Some(newLower))) - case (None, Some(u2)) => - if ((u2 isAssignableFrom lower) || (lower isAssignableFrom u2)) - Vector(TypeRange(newLower, Some(u2))) - else - Vector(TypeRange(newLower, Some(newLower))) - case (None, None) => - if (lower == other.lower) - Vector(TypeRange(newLower, None)) - else if (lower isAssignableFrom other.lower) - Vector(TypeRange(newLower, Some(other.lower)), TypeRange(other.lower, None)) - else if (other.lower isAssignableFrom lower) - Vector(TypeRange(newLower, Some(lower)), TypeRange(lower, None)) - else - Vector(TypeRange(newLower, Some(newLower))) - } - } - - def reparent(f: CypherType => CypherType): TypeRange = TypeRange(f(lower), upper.map(f)) -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/TypeSpec.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/TypeSpec.scala deleted file mode 100644 index 934d892cc2808..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/TypeSpec.scala +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.symbols - -import scala.language.postfixOps - -object TypeSpec { - def exact(types: CypherType*): TypeSpec = exact(types) - def exact[T <: CypherType](traversable: TraversableOnce[T]): TypeSpec = - TypeSpec(traversable.map(t => TypeRange(t, t))) - val all: TypeSpec = TypeSpec(TypeRange(CTAny, None)) - val none: TypeSpec = new TypeSpec(Vector.empty) - def union(typeSpecs: TypeSpec*): TypeSpec = TypeSpec(typeSpecs.flatMap(_.ranges)) - - def formatArguments(types: Seq[TypeSpec]) = - s"(${types.map(_.toShortString).mkString(", ")})" - - private val simpleTypes = Vector( - CTAny, - CTBoolean, - CTFloat, - CTInteger, - CTMap, - CTNode, - CTNumber, - CTPath, - CTRelationship, - CTPoint, - CTGeometry, - CTString, - CTGraphRef, - CTDuration, - CTDate, - CTTime, - CTLocalTime, - CTLocalDateTime, - CTDateTime - ) - - private def apply(range: TypeRange): TypeSpec = new TypeSpec(Vector(range)) - private def apply(ranges: TraversableOnce[TypeRange]): TypeSpec = - new TypeSpec(minimalRanges(ranges)) - - /** - * @param ranges a set of TypeRanges - * @return a minimal set of TypeRanges that have the same intersection of types - */ - private def minimalRanges(ranges: TraversableOnce[TypeRange]): Vector[TypeRange] = - ranges.foldLeft(Vector.empty[TypeRange]) { - case (set, range) => - if (set.exists(_ contains range)) - set - else - set.filterNot(range contains) :+ range - } -} - -/** - * A specification of types, that can match any set of types. - * - * @param ranges A set of TypeRanges, the intersection of which constitutes the entire set of types matched by this specification - */ -class TypeSpec(val ranges: Seq[TypeRange]) extends Equals { - def contains(that: CypherType): Boolean = contains(that, ranges) - private def contains(that: CypherType, rs: Seq[TypeRange]): Boolean = rs.exists(_ contains that) - - def containsAny(types: CypherType*): Boolean = containsAny(TypeSpec.exact(types)) - def containsAny(that: TypeSpec): Boolean = ranges.exists { r1 => - that.ranges.exists(r2 => (r1 constrain r2.lower).isDefined) - } - - def union(that: TypeSpec): TypeSpec = TypeSpec(ranges ++ that.ranges) - def |(that: TypeSpec): TypeSpec = union(that) - - def intersect(that: TypeSpec): TypeSpec = - TypeSpec(ranges.flatMap { r => - that.ranges.flatMap(r intersect) - }) - def &(that: TypeSpec): TypeSpec = intersect(that) - - def intersectOrCoerce(that: TypeSpec): TypeSpec = { - val intersection = intersect(that) - if (intersection.nonEmpty) - intersection - else - coercions intersect that - } - - def coerceOrLeastUpperBound(that: TypeSpec): TypeSpec = { - val coerced = coercions intersect that - if (coerced.nonEmpty) - coerced - else - this leastUpperBounds that - } - - def without(aType: CypherType): TypeSpec = TypeSpec(ranges.flatMap(_ without aType)) - - - def constrain(that: CypherType): TypeSpec = TypeSpec(ranges.flatMap(_ constrain that)) - - def constrainOrCoerce(that: CypherType): TypeSpec = { - val constrained = constrain(that) - if (constrained.nonEmpty) - constrained - else - coercions constrain that - } - - def leastUpperBounds(that: TypeSpec): TypeSpec = - TypeSpec(ranges.flatMap { r => - that.ranges.flatMap(r leastUpperBounds) - }) - - def wrapInList: TypeSpec = TypeSpec(ranges.map(_.reparent(CTList))) - - def wrapInCovariantList: TypeSpec = - TypeSpec(ranges.map { r => - r.covariant.reparent(CTList) - }) - - def covariant: TypeSpec = TypeSpec(ranges.map(_.covariant)) - - def unwrapLists: TypeSpec = TypeSpec(ranges.map(_.reparent { case c: ListType => c.innerType })) - - def coercions: TypeSpec = { - val simpleCoercions = ranges.flatMap(_.lower.coercibleTo) - TypeSpec.exact(simpleCoercions) - } - - def isEmpty: Boolean = ranges.isEmpty - def nonEmpty: Boolean = !isEmpty - - lazy val hasDefiniteSize: Boolean = ranges.forall(_.hasDefiniteSize) - - def toStream: Stream[CypherType] = toStream(ranges) - private def toStream(rs: => Seq[TypeRange]): Stream[CypherType] = - if (rs.isEmpty) - Stream() - else - TypeSpec.simpleTypes.filter(contains(_, rs)).toStream append toStream(innerTypeRanges(rs)) - .map(t => ListType(t)) - - def iterator: Iterator[CypherType] = toStream.iterator - - override def hashCode = 41 * ranges.hashCode - override def equals(that: Any): Boolean = that match { - case that: TypeSpec => - (that canEqual this) && { - val (finite1, infinite1) = ranges.partition(_.hasDefiniteSize) - val (finite2, infinite2) = that.ranges.partition(_.hasDefiniteSize) - (infinite1 == infinite2) && - ((finite1 == finite2) || (toStream(finite1) == toStream(finite2))) - } - case _ => false - } - override def canEqual(that: Any): Boolean = that.isInstanceOf[TypeSpec] - - def toStrings: IndexedSeq[String] = toStrings(Vector.empty, ranges, identity) - private def toStrings( - acc: IndexedSeq[String], - rs: Seq[TypeRange], - format: String => String - ): IndexedSeq[String] = - if (rs.isEmpty) - acc - else if (rs.exists({ - case TypeRange(_: AnyType, None) => true - case _ => false - })) - acc :+ format("T") - else - toStrings( - acc ++ TypeSpec.simpleTypes.filter(contains(_, rs)).map(t => format(t.toString)), - innerTypeRanges(rs), - t => s"List<${format(t)}>" - ) - - def mkString(sep: String): String = - mkString("", sep, sep, "") - def mkString(sep: String, lastSep: String): String = - mkString("", sep, lastSep, "") - def mkString(start: String, sep: String, end: String): String = - mkString(start, sep, sep, end) - def mkString(start: String, sep: String, lastSep: String, end: String): String = - addString(new StringBuilder(), start, sep, lastSep, end).toString() - - def addString( - b: StringBuilder, - start: String, - sep: String, - lastSep: String, - end: String - ): StringBuilder = { - val strings = toStrings - if (strings.length > 1) - strings - .dropRight(1) - .addString(b, start, sep, "") - .append(lastSep) - .append(strings.last) - .append(end) - else - strings.addString(b, start, sep, end) - } - - override def toString = mkString("TypeSpec(", ", ", ")") - - def toShortString = mkString("", " | ", "") - - private def innerTypeRanges(rs: Seq[TypeRange]): Seq[TypeRange] = rs.flatMap { - case TypeRange(c: ListType, Some(u: ListType)) => Some(TypeRange(c.innerType, u.innerType)) - case TypeRange(c: ListType, None) => Some(TypeRange(c.innerType, None)) - case TypeRange(_: AnyType, Some(u: ListType)) => Some(TypeRange(CTAny, u.innerType)) - case r @ TypeRange(_: AnyType, None) => Some(r) - case _ => None - } -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/package.scala b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/package.scala deleted file mode 100644 index 6c91c724d5e26..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/package.scala +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -import scala.language.implicitConversions - -package object symbols { - val CTAny: AnyType = AnyType.instance - val CTBoolean: BooleanType = BooleanType.instance - val CTString: StringType = StringType.instance - val CTNumber: NumberType = NumberType.instance - val CTFloat: FloatType = FloatType.instance - val CTInteger: IntegerType = IntegerType.instance - val CTMap: MapType = MapType.instance - val CTNode: NodeType = NodeType.instance - val CTRelationship: RelationshipType = RelationshipType.instance - val CTPoint: PointType = PointType.instance - val CTDateTime: DateTimeType = TemporalTypes.datetime - val CTLocalDateTime: LocalDateTimeType = TemporalTypes.localdatetime - val CTDate: DateType = TemporalTypes.date - val CTTime: TimeType = TemporalTypes.time - val CTLocalTime: LocalTimeType = TemporalTypes.localtime - val CTDuration: DurationType = TemporalTypes.duration - val CTGeometry: GeometryType = GeometryType.instance - val CTPath: PathType = PathType.instance - val CTGraphRef: GraphRefType = GraphRefType.instance - def CTList(inner: CypherType): ListType = ListType(inner) - - implicit def invariantTypeSpec(that: CypherType): TypeSpec = that.invariant -} diff --git a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/type_system.txt b/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/type_system.txt deleted file mode 100644 index a4dcf3888feb5..0000000000000 --- a/community/cypher/util-3.5/src/main/scala/org/neo4j/cypher/internal/util/v3_5/symbols/type_system.txt +++ /dev/null @@ -1,31 +0,0 @@ -Cypher tries to be type safe within a query. That means that it tries to stop -you from building nonsensical queries, e.g. a pattern where an variable is -used first as a pattern path and then a pattern node. MATCH n = n-->() - -To do this, it has a hierarchy of types, with Any as the root of it all. - - /-----------/------Any----\---------\--------\------------\ - / / \ \ \ \ - / Number Map \ \ \ - / / \ / \ \ \ \ - CTString CTInteger CTFloat CTNode CTRel CTPath CTBoolean CTList - -All expressions have a type. Some expressions type depend on other expressions types - -e.g. LAST(x) will have type T, given that x has type List. - -An expression can also have an expectation about inner expressions type, LENGTH(X) -expects that X is an List. These expectations are met by any subtype of the -expected type - e.g. if the expectation is a Number, Float and Integer are fine, but -not a String. - -An expression has dependencies on what variables exists in the symbol table, -and their types. An example is always in place: - -+`LENGTH(FILTER(n in nodes(p) WHERE n.prop = 'foo'))`+ - -In this expression, LENGTH has an expectation on FILTER, and FILTER has one on NODES, -and so one. But the dependency on variables on the symbol table is just one - it has -to have an variable named 'p', and it's type is expected to be a List. - -Lists can also be coerced into booleans - non-empty lists are true, and empty -are false. diff --git a/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/DummyPosition.scala b/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/DummyPosition.scala deleted file mode 100644 index 94e68b647008d..0000000000000 --- a/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/DummyPosition.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -object DummyPosition { - def apply(offset: Int) = new InputPosition(offset, 1, offset) -} diff --git a/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/EagerlyTest.scala b/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/EagerlyTest.scala deleted file mode 100644 index 078b62f68399b..0000000000000 --- a/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/EagerlyTest.scala +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite - -import scala.collection.{immutable, mutable} - -class EagerlyTest extends CypherFunSuite { - test("maps values of immutable maps to immutable maps") { - val result = Eagerly.immutableMapValues(immutable.Map("a" -> 1, "b" ->2), (x: Int) => x * 2) - val expectation = immutable.Map("a" -> 2, "b" -> 4) - - result should equal(expectation) - result.getClass should equal(expectation.getClass) - } - - test("maps values of mutable maps to immutable maps") { - val result = Eagerly.immutableMapValues(mutable.Map("a" -> 1, "b" ->2), (x: Int) => x * 2) - val expectation = immutable.Map("a" -> 2, "b" -> 4) - - result should equal(expectation) - result.getClass should equal(expectation.getClass) - } - - test("maps values of immutable maps to mutable maps") { - val result = Eagerly.mutableMapValues(immutable.Map("a" -> 1, "b" ->2), (x: Int) => x * 2) - val expectation = mutable.Map("a" -> 2, "b" -> 4) - - result should equal(expectation) - result.getClass should equal(expectation.getClass) - } - - test("maps values of mutable maps to mutable maps") { - val result = Eagerly.mutableMapValues(mutable.Map("a" -> 1, "b" ->2), (x: Int) => x * 2) - val expectation = mutable.Map("a" -> 2, "b" -> 4) - - result should equal(expectation) - result.getClass should equal(expectation.getClass) - } - - test("replaces keys on empty map") { - val result = Eagerly.immutableReplaceKeys[Any, Any](Map.empty)("a" -> 1) - - result should be(empty) - } - - test("replaces keys on non-empty map") { - val result = Eagerly.immutableReplaceKeys(Map("a" -> 10))("a" -> "a", "a" -> "b") - - result should equal(Map("a" -> 10, "b" -> 10)) - } -} diff --git a/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/RewritableTest.scala b/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/RewritableTest.scala deleted file mode 100644 index 1807816ed0584..0000000000000 --- a/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/RewritableTest.scala +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite - -import scala.collection.mutable.ListBuffer - -object RewritableTest { - trait Exp extends Product with Rewritable - case class Val(int: Int) extends Exp { - def dup(children: Seq[AnyRef]): this.type = - Val(children.head.asInstanceOf[Int]).asInstanceOf[this.type] - } - case class Add(lhs: Exp, rhs: Exp) extends Exp { - def dup(children: Seq[AnyRef]): this.type = - Add(children.head.asInstanceOf[Exp], children(1).asInstanceOf[Exp]).asInstanceOf[this.type] - } - case class Sum(args: Seq[Exp]) extends Exp { - def dup(children: Seq[AnyRef]): this.type = - Sum(children.head.asInstanceOf[Seq[Exp]]).asInstanceOf[this.type] - } - case class Pos(latlng: (Exp, Exp)) extends Exp { - def dup(children: Seq[AnyRef]): this.type = - Pos(children.head.asInstanceOf[(Exp, Exp)]).asInstanceOf[this.type] - } - case class Options(args: Seq[(Exp, Exp)]) extends Exp { - def dup(children: Seq[AnyRef]): this.type = - Options(children.head.asInstanceOf[Seq[(Exp, Exp)]]).asInstanceOf[this.type] - } -} - -class RewritableTest extends CypherFunSuite { - import RewritableTest._ - - test("topDown should be identical when no rule matches") { - val ast = Add(Val(1), Add(Val(2), Val(3))) - - val result = ast.rewrite(topDown(Rewriter.lift { - case None => ??? - })) - - assert(result === ast) - } - - test("topDown should be identical when using identity") { - val ast = Add(Val(1), Add(Val(2), Val(3))) - - val result = ast.rewrite(topDown(Rewriter.lift { - case a => a - })) - - assert(result === ast) - } - - test("topDown should match and replace primitives") { - val ast = Add(Val(1), Add(Val(2), Val(3))) - - val result = ast.rewrite(topDown(Rewriter.lift { - case _: java.lang.Integer => 99: java.lang.Integer - })) - - assert(result === Add(Val(99), Add(Val(99), Val(99)))) - } - - test("topDown should match and replace trees") { - val ast = Add(Val(1), Add(Val(2), Val(3))) - - val result = ast.rewrite(topDown(Rewriter.lift { - case Add(Val(x), Val(y)) => - Val(x + y) - })) - - assert(result === Add(Val(1), Val(5))) - } - - test("topDown should match and replace primitives and trees") { - val ast = Add(Val(8), Add(Val(2), Val(3))) - - val result = ast.rewrite(topDown(Rewriter.lift { - case Val(_) => - Val(1) - case Add(Val(x), Val(y)) => - Val(x + y) - })) - - assert(result === Add(Val(1), Val(5))) - } - - test("topDown should duplicate terms with pair parameters") { - val ast = Add(Val(1), Pos((Val(2), Val(3)))) - - val result = ast.rewrite(topDown(Rewriter.lift { - case Val(_) => Val(99) - })) - - assert(result === Add(Val(99), Pos((Val(99), Val(99))))) - } - - test("topDown should duplicate terms with sequence of pairs") { - val ast = Add(Val(1), Options(Seq((Val(2), Val(3)), (Val(4), Val(5))))) - - val result = ast.rewrite(topDown(Rewriter.lift { - case Val(_) => Val(99) - })) - - assert(result === Add(Val(99), Options(Seq((Val(99), Val(99)), (Val(99), Val(99)))))) - } - - test("bottomUp should be identical when no rule matches") { - val ast = Add(Val(1), Add(Val(2), Val(3))) - - val result = ast.rewrite(bottomUp(Rewriter.lift { - case None => ??? - })) - - assert(result === ast) - } - - test("bottomUp should be identical when using identity") { - val ast = Add(Val(1), Add(Val(2), Val(3))) - - val result = ast.rewrite(bottomUp(Rewriter.lift { - case a => a - })) - - assert(result === ast) - } - - test("bottomUp should match and replace primitives") { - val ast = Add(Val(1), Add(Val(2), Val(3))) - - val result = ast.rewrite(bottomUp(Rewriter.lift { - case _: java.lang.Integer => 99: java.lang.Integer - })) - - assert(result === Add(Val(99), Add(Val(99), Val(99)))) - } - - test("bottomUp should match and replace trees") { - val ast = Add(Val(1), Add(Val(2), Val(3))) - - val result = ast.rewrite(bottomUp(Rewriter.lift { - case Add(Val(x), Val(y)) => - Val(x + y) - })) - - assert(result === Val(6)) - } - - test("bottomUp should match and replace primitives and trees") { - val ast = Add(Val(8), Add(Val(2), Val(3))) - - val result = ast.rewrite(bottomUp(Rewriter.lift { - case Val(_) => - Val(1) - case Add(Val(x), Val(y)) => - Val(x + y) - })) - - assert(result === Val(3)) - } - - test("bottomUp should duplicate terms with pair parameters") { - val ast = Add(Val(1), Pos((Val(2), Val(3)))) - - val result = ast.rewrite(bottomUp(Rewriter.lift { - case Val(_) => Val(99) - })) - - assert(result === Add(Val(99), Pos((Val(99), Val(99))))) - } - - test("bottomUp should duplicate terms with sequence of pairs") { - val ast = Add(Val(1), Options(Seq((Val(2), Val(3)), (Val(4), Val(5))))) - - val result = ast.rewrite(bottomUp(Rewriter.lift { - case Val(_) => Val(99) - })) - - assert(result === Add(Val(99), Options(Seq((Val(99), Val(99)), (Val(99), Val(99)))))) - } - - test("should not create unnecessary copies of objects that have Seq's as Children (when using ListBuffer)") { - import org.neo4j.cypher.internal.util.v3_5.Rewritable._ - import org.neo4j.cypher.internal.util.v3_5.Foldable._ - - case class Thing(texts: Seq[String]) extends Rewritable { - def dup(children: Seq[AnyRef]): this.type = - if (children.iterator eqElements this.children) - this - else { - Thing(children.head.asInstanceOf[Seq[String]]).asInstanceOf[this.type] - } - } - case object NotUsed - - val thing = Thing(ListBuffer("a", "b", "c")) - val rewritten = thing.rewrite(bottomUp(Rewriter.lift { - case NotUsed => NotUsed - })) - - rewritten should be theSameInstanceAs(thing) - } -} \ No newline at end of file diff --git a/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/TaskCloserTest.scala b/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/TaskCloserTest.scala deleted file mode 100644 index 84c2dc9c534ea..0000000000000 --- a/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/TaskCloserTest.scala +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.scalatest.BeforeAndAfter - -class TaskCloserTest extends CypherFunSuite with BeforeAndAfter { - var taskCloser: TaskCloser = _ - var ran = false - var outcome = false - - before { - taskCloser = new TaskCloser - ran = false - } - - test("cleanUp call methods") { - taskCloser.addTask(closingTask) - taskCloser.close(success = true) - - ran should equal(true) - outcome should equal(true) - } - - test("cleanUp call methods and pass on the success") { - outcome = true - - taskCloser.addTask(closingTask) - taskCloser.close(success = false) - - ran should equal(true) - outcome should equal(false) - } - - test("cleanUp calls all cleanUp methods even if some fail") { - taskCloser.addTask(_ => throw new Exception("oh noes")) - taskCloser.addTask(closingTask) - - intercept[Exception](taskCloser.close(success = true)) - - ran should equal(true) - outcome should equal(true) - } - - test("cleanUp calls all cleanUp and if there are failures the first exception is thrown") { - val expected = new Exception("oh noes") - taskCloser.addTask(_ => throw new Exception) - taskCloser.addTask(_ => throw expected) - - val ex = intercept[Exception](taskCloser.close(success = true)) - - ex should equal(expected) - } - - test("does not close twice") { - val expected = new Exception("oh noes") - taskCloser.addTask(closingTask) - - taskCloser.close(success = true) - ran = false - taskCloser.close(success = true) - - // If we close the closer twice, it should only run this once - ran should not equal(true) - } - - test("cleanup without any cleanups does not fail") { - taskCloser.close(success = true) - - ran should equal(false) - } - - private def closingTask(success:Boolean) = { - ran = true - outcome = success - } - -} diff --git a/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/ZeroOneOrManyTest.scala b/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/ZeroOneOrManyTest.scala deleted file mode 100644 index f2729d40294d5..0000000000000 --- a/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/ZeroOneOrManyTest.scala +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5 - -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite - -class ZeroOneOrManyTest extends CypherFunSuite { - - test("zero") { - ZeroOneOrMany(Seq.empty) should be(Zero) - } - - test("one") { - ZeroOneOrMany(Seq('a)) should be(One('a)) - } - - test("many") { - ZeroOneOrMany(Seq('a, 'b)) should be(Many(Seq('a, 'b))) - } -} diff --git a/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/attribution/AttributeTest.scala b/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/attribution/AttributeTest.scala deleted file mode 100644 index 2fc264600bf8b..0000000000000 --- a/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/attribution/AttributeTest.scala +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.attribution - -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite - -class AttributeTest extends CypherFunSuite { - - class TestAttribute extends Attribute[Int] - - test("test set") { - val attr = new TestAttribute - attr.set(Id(2), 33) - - attr.get(Id(2)) should be(33) - a[Exception] should be thrownBy attr.get(Id(1)) - a[Exception] should be thrownBy attr.get(Id(3)) - } - - test("test isDefinedAt") { - val attr = new TestAttribute - attr.set(Id(2), 33) - attr.set(Id(4), 27) - - attr.isDefinedAt(Id(1)) should be(false) - attr.isDefinedAt(Id(2)) should be(true) - attr.isDefinedAt(Id(3)) should be(false) - attr.isDefinedAt(Id(4)) should be(true) - - } - - test("test iterator") { - val attr = new TestAttribute - attr.set(Id(2), 33) - attr.set(Id(4), 27) - - val iter = attr.iterator - iter.hasNext should be(true) - iter.next() should be((Id(2),33)) - iter.hasNext should be(true) - iter.next() should be((Id(4),27)) - iter.hasNext should be(false) - intercept[NoSuchElementException](iter.next()) - } - - test("test empty iterator with hasNext") { - val attr = new TestAttribute - val iter = attr.iterator - iter.hasNext should be(false) - intercept[NoSuchElementException](iter.next()) - } - - test("test empty iterator without hasNext") { - val attr = new TestAttribute - val iter = attr.iterator - intercept[NoSuchElementException](iter.next()) - } - - test("test size") { - val attr = new TestAttribute - attr.set(Id(2), 33) - attr.set(Id(4), 27) - attr.size should be(2) - - val attr2 = new TestAttribute - attr2.size should be(0) - } - -} diff --git a/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/test_helpers/CypherFunSuite.scala b/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/test_helpers/CypherFunSuite.scala deleted file mode 100644 index a3a17c841579c..0000000000000 --- a/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/test_helpers/CypherFunSuite.scala +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.test_helpers - -import org.junit.runner.RunWith -import org.mockito.ArgumentCaptor -import org.scalatest._ -import org.scalatest.junit.JUnitRunner -import org.scalatest.mock.MockitoSugar - -import scala.reflect.Manifest - -@RunWith(classOf[JUnitRunner]) -abstract class CypherFunSuite - extends Suite - with Assertions - with CypherTestSupport - with MockitoSugar - with FunSuiteLike - with Matchers - with BeforeAndAfterEach { - - override protected def beforeEach() { - initTest() - } - - override protected def afterEach() { - stopTest() - } - - def argCaptor[T <: AnyRef](implicit manifest: Manifest[T]): ArgumentCaptor[T] = { - ArgumentCaptor.forClass(manifest.runtimeClass.asInstanceOf[Class[T]]) - } -} - -trait TestName extends Suite { - final def testName = __testName.get - - private var __testName: Option[String] = None - - override protected def runTest(testName: String, args: Args): Status = { - __testName = Some(testName) - try { - super.runTest(testName, args) - } finally { - __testName = None - } - } -} diff --git a/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/test_helpers/CypherTestSupport.scala b/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/test_helpers/CypherTestSupport.scala deleted file mode 100644 index ff299690fc459..0000000000000 --- a/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/test_helpers/CypherTestSupport.scala +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.test_helpers - -// Inherited by test mixin classes that need to manage resources -trait CypherTestSupport { - protected def initTest() {} - protected def stopTest() {} -} diff --git a/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/test_helpers/IgnoreAllTests.scala b/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/test_helpers/IgnoreAllTests.scala deleted file mode 100644 index faa058194ea82..0000000000000 --- a/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/test_helpers/IgnoreAllTests.scala +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.test_helpers - -import org.scalatest.Tag - -trait IgnoreAllTests extends CypherFunSuite { - - def ignoranceRationale = "" - - abstract override protected def test(testName: String, testTags: Tag*)(testFun: => Unit) { - val ignoredTestName = - if (ignoranceRationale.isEmpty) testName else s"testName [$ignoranceRationale]" - ignore(ignoredTestName, testTags: _*)(testFun) - } - - protected def testIgnored(testName: String, testTags: Tag*)(testFun: => Unit): Unit = { - super.test(testName, testTags: _*)(testFun) - } -} diff --git a/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/test_helpers/WindowsStringSafe.scala b/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/test_helpers/WindowsStringSafe.scala deleted file mode 100644 index ba7cf469cb293..0000000000000 --- a/community/cypher/util-3.5/src/test/scala/org/neo4j/cypher/internal/util/v3_5/test_helpers/WindowsStringSafe.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.neo4j.cypher.internal.util.v3_5.test_helpers - -import org.scalactic.Equality - -// Makes it easy to compare strings without having to worry about new lines -object WindowsStringSafe extends Equality[String] { - override def areEqual(a: String, b: Any) = b match { - case b: String => - a.replaceAll("\r\n", "\n") equals b.replaceAll("\r\n", "\n") - case _ => false - } -} diff --git a/community/neo4j-community/LICENSES.txt b/community/neo4j-community/LICENSES.txt index 205ba73deb76a..2286a00132871 100644 --- a/community/neo4j-community/LICENSES.txt +++ b/community/neo4j-community/LICENSES.txt @@ -21,6 +21,12 @@ Apache Software License, Version 2.0 Netty/All-in-One Objenesis opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala WMI4Java diff --git a/community/neo4j-community/NOTICE.txt b/community/neo4j-community/NOTICE.txt index 9935a8f6ee3c4..1b5078a33fc5f 100644 --- a/community/neo4j-community/NOTICE.txt +++ b/community/neo4j-community/NOTICE.txt @@ -44,6 +44,12 @@ Apache Software License, Version 2.0 Netty/All-in-One Objenesis opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala WMI4Java diff --git a/community/neo4j-harness/LICENSES.txt b/community/neo4j-harness/LICENSES.txt index d6cff4833e04a..10bacb063f6b1 100644 --- a/community/neo4j-harness/LICENSES.txt +++ b/community/neo4j-harness/LICENSES.txt @@ -37,6 +37,12 @@ Apache Software License, Version 2.0 Netty/All-in-One Objenesis opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala WMI4Java diff --git a/community/neo4j-harness/NOTICE.txt b/community/neo4j-harness/NOTICE.txt index 48847dcf37fd2..9745084381e66 100644 --- a/community/neo4j-harness/NOTICE.txt +++ b/community/neo4j-harness/NOTICE.txt @@ -60,6 +60,12 @@ Apache Software License, Version 2.0 Netty/All-in-One Objenesis opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala WMI4Java diff --git a/community/neo4j/LICENSES.txt b/community/neo4j/LICENSES.txt index 8a5352f563a97..ed908a7e3e742 100644 --- a/community/neo4j/LICENSES.txt +++ b/community/neo4j/LICENSES.txt @@ -19,6 +19,12 @@ Apache Software License, Version 2.0 Netty/All-in-One Objenesis opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala WMI4Java diff --git a/community/neo4j/NOTICE.txt b/community/neo4j/NOTICE.txt index 33afd6e62b61a..6fd70969012bb 100644 --- a/community/neo4j/NOTICE.txt +++ b/community/neo4j/NOTICE.txt @@ -42,6 +42,12 @@ Apache Software License, Version 2.0 Netty/All-in-One Objenesis opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala WMI4Java diff --git a/community/server-plugin-test/LICENSES.txt b/community/server-plugin-test/LICENSES.txt index 4c283b886f829..8a3882337a4ce 100644 --- a/community/server-plugin-test/LICENSES.txt +++ b/community/server-plugin-test/LICENSES.txt @@ -34,6 +34,12 @@ Apache Software License, Version 2.0 Netty/All-in-One Objenesis opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala WMI4Java diff --git a/community/server-plugin-test/NOTICE.txt b/community/server-plugin-test/NOTICE.txt index a012006895597..e6b4c2711962c 100644 --- a/community/server-plugin-test/NOTICE.txt +++ b/community/server-plugin-test/NOTICE.txt @@ -57,6 +57,12 @@ Apache Software License, Version 2.0 Netty/All-in-One Objenesis opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala WMI4Java diff --git a/community/server/LICENSES.txt b/community/server/LICENSES.txt index 4c283b886f829..8a3882337a4ce 100644 --- a/community/server/LICENSES.txt +++ b/community/server/LICENSES.txt @@ -34,6 +34,12 @@ Apache Software License, Version 2.0 Netty/All-in-One Objenesis opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala WMI4Java diff --git a/community/server/NOTICE.txt b/community/server/NOTICE.txt index a012006895597..e6b4c2711962c 100644 --- a/community/server/NOTICE.txt +++ b/community/server/NOTICE.txt @@ -57,6 +57,12 @@ Apache Software License, Version 2.0 Netty/All-in-One Objenesis opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala WMI4Java diff --git a/enterprise/cypher/acceptance-spec-suite/LICENSES.txt b/enterprise/cypher/acceptance-spec-suite/LICENSES.txt index ecd0ecd4ab76c..20f17698bfa8b 100644 --- a/enterprise/cypher/acceptance-spec-suite/LICENSES.txt +++ b/enterprise/cypher/acceptance-spec-suite/LICENSES.txt @@ -16,6 +16,12 @@ Apache Software License, Version 2.0 Lucene QueryParsers Netty/All-in-One opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala ------------------------------------------------------------------------------ diff --git a/enterprise/cypher/acceptance-spec-suite/NOTICE.txt b/enterprise/cypher/acceptance-spec-suite/NOTICE.txt index 1f7bdc6ee5033..49757a3cce16e 100644 --- a/enterprise/cypher/acceptance-spec-suite/NOTICE.txt +++ b/enterprise/cypher/acceptance-spec-suite/NOTICE.txt @@ -38,6 +38,12 @@ Apache Software License, Version 2.0 Lucene QueryParsers Netty/All-in-One opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala diff --git a/enterprise/cypher/acceptance-spec-suite/pom.xml b/enterprise/cypher/acceptance-spec-suite/pom.xml index 7d0eba383e6d9..367bfb561a1f1 100644 --- a/enterprise/cypher/acceptance-spec-suite/pom.xml +++ b/enterprise/cypher/acceptance-spec-suite/pom.xml @@ -190,20 +190,21 @@ - org.neo4j - openCypher-frontend-1 - ${project.version} + org.opencypher + ast-9.0 + ${openCypher.version} test-jar test - org.neo4j - neo4j-cypher-util-3.5 - ${project.version} + org.opencypher + util-9.0 + ${openCypher.version} test-jar test + org.neo4j neo4j-cypher-spec-suite-tools diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CartesianProductNotificationAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CartesianProductNotificationAcceptanceTest.scala index 99e7acc7a4b1e..d58d1b532bbc4 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CartesianProductNotificationAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CartesianProductNotificationAcceptanceTest.scala @@ -30,16 +30,15 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.helpers.simpleExpres import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{CommunityRuntimeContext, CommunityRuntimeContextCreator} import org.neo4j.cypher.internal.compiler.v3_5._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{CachedMetricsFactory, SimpleMetricsFactory} -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.RewriterStepSequencer -import org.neo4j.cypher.internal.frontend.v3_5.notification.CartesianProductNotification -import org.neo4j.cypher.internal.frontend.v3_5.phases.{CompilationPhaseTracer, InternalNotificationLogger, devNullLogger} +import org.opencypher.v9_0.frontend.phases.{CompilationPhaseTracer, InternalNotificationLogger, devNullLogger} import org.neo4j.cypher.internal.planner.v3_5.spi.{IDPPlannerName, PlanContext} import org.neo4j.cypher.internal.runtime.interpreted.{TransactionBoundPlanContext, TransactionalContextWrapper} -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.util.v3_5.attribution.SequentialIdGen -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.{CartesianProductNotification, InputPosition} +import org.opencypher.v9_0.util.attribution.SequentialIdGen +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.kernel.api.{KernelTransaction, Statement} import org.neo4j.kernel.impl.core.ThreadToStatementContextBridge +import org.opencypher.v9_0.rewriting.RewriterStepSequencer class CartesianProductNotificationAcceptanceTest extends CypherFunSuite with GraphDatabaseTestSupport { var logger: InternalNotificationLogger = _ diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CompositeNodeKeyConstraintAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CompositeNodeKeyConstraintAcceptanceTest.scala index 3b9d909d3c119..f42eee3f955f8 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CompositeNodeKeyConstraintAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CompositeNodeKeyConstraintAcceptanceTest.scala @@ -22,7 +22,7 @@ package org.neo4j.internal.cypher.acceptance import java.time.{LocalDate, LocalDateTime} import org.neo4j.cypher._ -import org.neo4j.cypher.internal.frontend.v3_5.helpers.StringHelper._ +import org.opencypher.v9_0.util.helpers.StringHelper._ import org.neo4j.graphdb.ConstraintViolationException import org.neo4j.internal.cypher.acceptance.CypherComparisonSupport._ diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CypherComparisonSupport.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CypherComparisonSupport.scala index 1e17f1846a94d..0a712028294f1 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CypherComparisonSupport.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CypherComparisonSupport.scala @@ -25,8 +25,8 @@ import org.neo4j.cypher.internal.compiler.v3_1.{CartesianPoint => CartesianPoint import org.neo4j.cypher.internal.runtime.InternalExecutionResult import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments.{Planner => IPDPlanner, PlannerVersion => IPDPlannerVersion, Runtime => IPDRuntime, RuntimeVersion => IPDRuntimeVersion} -import org.neo4j.cypher.internal.util.v3_5.Eagerly -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherTestSupport +import org.opencypher.v9_0.util.Eagerly +import org.opencypher.v9_0.util.test_helpers.CypherTestSupport import org.neo4j.graphdb.Result import org.neo4j.graphdb.config.Setting import org.neo4j.graphdb.factory.GraphDatabaseSettings diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/DebugToStringTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/DebugToStringTest.scala index c4a5c8ba085a8..02a4a97c73463 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/DebugToStringTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/DebugToStringTest.scala @@ -20,7 +20,7 @@ package org.neo4j.internal.cypher.acceptance import org.neo4j.cypher.ExecutionEngineFunSuite -import org.neo4j.cypher.internal.util.v3_5.test_helpers.WindowsStringSafe +import org.opencypher.v9_0.util.test_helpers.WindowsStringSafe class DebugToStringTest extends ExecutionEngineFunSuite { diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/DumpToStringAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/DumpToStringAcceptanceTest.scala index 475976d043061..18960ec372b7b 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/DumpToStringAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/DumpToStringAcceptanceTest.scala @@ -20,7 +20,7 @@ package org.neo4j.internal.cypher.acceptance import org.neo4j.cypher.ExecutionEngineFunSuite -import org.neo4j.cypher.internal.util.v3_5.test_helpers.WindowsStringSafe +import org.opencypher.v9_0.util.test_helpers.WindowsStringSafe import org.neo4j.internal.cypher.acceptance.CypherComparisonSupport.Configs class DumpToStringAcceptanceTest extends ExecutionEngineFunSuite with CypherComparisonSupport { diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ExecutionEngineTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ExecutionEngineTest.scala index 8fcdad14d02e7..ecee2e99a3b4e 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ExecutionEngineTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ExecutionEngineTest.scala @@ -24,7 +24,7 @@ import java.io.{File, PrintWriter} import org.neo4j.cypher.ExecutionEngineHelper.createEngine import org.neo4j.cypher._ import org.neo4j.cypher.internal.ExecutionEngine -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase import org.neo4j.cypher.internal.javacompat.GraphDatabaseCypherService import org.neo4j.cypher.internal.runtime.CreateTempFileTestSupport import org.neo4j.cypher.internal.tracing.TimingCompilationTracer diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/GrammarStressIT.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/GrammarStressIT.scala index a136c4ab3b422..f2607f07d6f99 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/GrammarStressIT.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/GrammarStressIT.scala @@ -19,7 +19,7 @@ */ package org.neo4j.internal.cypher.acceptance -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.cypher.ExecutionEngineFunSuite import org.neo4j.graphdb.Node import org.neo4j.graphdb.config.Setting diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/LoadCsvAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/LoadCsvAcceptanceTest.scala index 0223b24266ad4..d299d3a72501a 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/LoadCsvAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/LoadCsvAcceptanceTest.scala @@ -25,7 +25,7 @@ import java.nio.file.Files import java.util.Collections.emptyMap import org.neo4j.cypher._ -import org.neo4j.cypher.internal.frontend.v3_5.helpers.StringHelper.RichString +import org.opencypher.v9_0.util.helpers.StringHelper.RichString import org.neo4j.cypher.internal.runtime.CreateTempFileTestSupport import org.neo4j.cypher.internal.v3_5.logical.plans.NodeIndexSeek import org.neo4j.graphdb.QueryExecutionException diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/LoadCsvAcceptanceUserAgentTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/LoadCsvAcceptanceUserAgentTest.scala index 103e6bb33c9b0..1870b26f4a89d 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/LoadCsvAcceptanceUserAgentTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/LoadCsvAcceptanceUserAgentTest.scala @@ -20,7 +20,7 @@ package org.neo4j.internal.cypher.acceptance import org.neo4j.cypher._ -import org.neo4j.cypher.internal.frontend.v3_5.helpers.StringHelper.RichString +import org.opencypher.v9_0.util.helpers.StringHelper.RichString import org.neo4j.cypher.internal.runtime.interpreted.CSVResources import org.neo4j.internal.cypher.acceptance.CypherComparisonSupport.Configs import org.scalatest.BeforeAndAfterAll diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/Neo4jValueComparisonTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/Neo4jValueComparisonTest.scala index 42edc08c51dca..33e4689b71566 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/Neo4jValueComparisonTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/Neo4jValueComparisonTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.internal.cypher.acceptance -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.scalacheck._ class Neo4jValueComparisonTest extends CypherFunSuite { diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/NotificationAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/NotificationAcceptanceTest.scala index fba72fb2d1554..acd11cc0ca2f1 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/NotificationAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/NotificationAcceptanceTest.scala @@ -20,7 +20,6 @@ package org.neo4j.internal.cypher.acceptance import org.neo4j.cypher.ExecutionEngineFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.notification._ import org.neo4j.cypher.internal.javacompat.NotificationAcceptanceTest.ChangedResults import org.neo4j.graphdb import org.neo4j.graphdb.config.Setting @@ -31,6 +30,7 @@ import org.neo4j.graphdb.impl.notification.{NotificationCode, NotificationDetail import org.neo4j.internal.cypher.acceptance.CypherComparisonSupport.Configs import org.neo4j.kernel.impl.proc.Procedures import org.neo4j.procedure.Procedure +import org.opencypher.v9_0.util.PlannerUnsupportedNotification import scala.collection.JavaConverters._ diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/PatternExpressionImplementationAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/PatternExpressionImplementationAcceptanceTest.scala index 69803f3a131a3..8e4c6a7b9e332 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/PatternExpressionImplementationAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/PatternExpressionImplementationAcceptanceTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.internal.cypher.acceptance -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.cypher.ExecutionEngineFunSuite import org.neo4j.cypher.internal.runtime.PathImpl import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments.{EstimatedRows, ExpandExpression} diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/PeriodicCommitAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/PeriodicCommitAcceptanceTest.scala index fe77ceac0160d..ba43d123e81d9 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/PeriodicCommitAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/PeriodicCommitAcceptanceTest.scala @@ -22,7 +22,7 @@ package org.neo4j.internal.cypher.acceptance import java.io.PrintWriter import org.neo4j.cypher._ -import org.neo4j.cypher.internal.frontend.v3_5.helpers.StringHelper.RichString +import org.opencypher.v9_0.util.helpers.StringHelper.RichString import org.neo4j.cypher.internal.runtime.CreateTempFileTestSupport import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments.{PageCacheHits, PageCacheMisses, PlannerImpl} import org.neo4j.graphdb.Node diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/PreParsingAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/PreParsingAcceptanceTest.scala index 3a880d730172c..4dde2d3c5d071 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/PreParsingAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/PreParsingAcceptanceTest.scala @@ -20,7 +20,7 @@ package org.neo4j.internal.cypher.acceptance import org.neo4j.cypher.ExecutionEngineFunSuite -import org.neo4j.cypher.internal.frontend.v3_5.PlannerName +import org.opencypher.v9_0.frontend.PlannerName import org.neo4j.cypher.internal.planner.v3_5.spi.{DPPlannerName, IDPPlannerName} import org.neo4j.cypher.internal.runtime.InternalExecutionResult import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ProfilerAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ProfilerAcceptanceTest.scala index a983220b00a98..70c34b445ed97 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ProfilerAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ProfilerAcceptanceTest.scala @@ -19,12 +19,12 @@ */ package org.neo4j.internal.cypher.acceptance -import org.neo4j.cypher.internal.frontend.v3_5.helpers.StringHelper.RichString +import org.opencypher.v9_0.util.helpers.StringHelper.RichString import org.neo4j.cypher.internal.planner.v3_5.spi.GraphStatistics import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments.{DbHits, EstimatedRows, Rows, Signature} import org.neo4j.cypher.internal.runtime.planDescription.{Argument, InternalPlanDescription} import org.neo4j.cypher.internal.runtime.{CreateTempFileTestSupport, InternalExecutionResult} -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ import org.neo4j.cypher.internal.v3_5.logical.plans.QualifiedName import org.neo4j.cypher.{ExecutionEngineFunSuite, ProfilerStatisticsNotReadyException, TxCounts} import org.neo4j.graphdb.QueryExecutionException diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/QueryPlanCompactionAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/QueryPlanCompactionAcceptanceTest.scala index b6c8bb4334676..d87e2e0113971 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/QueryPlanCompactionAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/QueryPlanCompactionAcceptanceTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.internal.cypher.acceptance -import org.neo4j.cypher.internal.util.v3_5.test_helpers.WindowsStringSafe +import org.opencypher.v9_0.util.test_helpers.WindowsStringSafe import org.neo4j.cypher.{ExecutionEngineFunSuite, QueryStatisticsTestSupport} import org.neo4j.internal.cypher.acceptance.CypherComparisonSupport._ diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SemanticCreateAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SemanticCreateAcceptanceTest.scala index 2efdab9b4a942..2f4f1fde704e9 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SemanticCreateAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SemanticCreateAcceptanceTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.internal.cypher.acceptance -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.cypher.{ExecutionEngineFunSuite, PatternGen} import org.neo4j.graphdb.ResourceIterator import org.scalacheck.{Gen, Shrink} diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SemanticDeleteAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SemanticDeleteAcceptanceTest.scala index 12a289bf11479..5ea7d3989431c 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SemanticDeleteAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SemanticDeleteAcceptanceTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.internal.cypher.acceptance -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.cypher.internal.RewindableExecutionResult import org.neo4j.cypher.{ExecutionEngineFunSuite, PatternGen} import org.scalacheck.{Gen, Shrink} diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SemanticErrorAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SemanticErrorAcceptanceTest.scala index 77614f9dc975e..8a4f0bde74841 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SemanticErrorAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SemanticErrorAcceptanceTest.scala @@ -509,7 +509,7 @@ class SemanticErrorAcceptanceTest extends ExecutionEngineFunSuite { } private def executeAndEnsureError(query: String, expected: Seq[String], params: (String,Any)*) { - import org.neo4j.cypher.internal.frontend.v3_5.helpers.StringHelper._ + import org.opencypher.v9_0.util.helpers.StringHelper._ import scala.collection.JavaConverters._ val expectedErrorString = expected.map(e => s"'$e'").mkString(" or ") diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SemanticMergeAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SemanticMergeAcceptanceTest.scala index 3dde723944199..36ad312dcdfa4 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SemanticMergeAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SemanticMergeAcceptanceTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.internal.cypher.acceptance -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.cypher.internal.RewindableExecutionResult import org.neo4j.cypher.{ExecutionEngineFunSuite, PatternGen, QueryStatisticsTestSupport} import org.neo4j.graphdb.ResourceIterator diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ShortestPathExhaustiveForbiddenAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ShortestPathExhaustiveForbiddenAcceptanceTest.scala index fa7978f1f7259..02a6edc665a89 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ShortestPathExhaustiveForbiddenAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ShortestPathExhaustiveForbiddenAcceptanceTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.internal.cypher.acceptance -import org.neo4j.cypher.internal.util.v3_5.{ExhaustiveShortestPathForbiddenException => InternalExhaustiveShortestPathForbiddenException} +import org.opencypher.v9_0.util.{ExhaustiveShortestPathForbiddenException => InternalExhaustiveShortestPathForbiddenException} import org.neo4j.cypher.ExecutionEngineFunSuite import org.neo4j.graphdb.Node import org.neo4j.graphdb.config.Setting diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ShortestPathLongerAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ShortestPathLongerAcceptanceTest.scala index 972514028cc0e..94f54f3c305b4 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ShortestPathLongerAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ShortestPathLongerAcceptanceTest.scala @@ -26,7 +26,7 @@ import org.neo4j.cypher.internal.RewindableExecutionResult import org.neo4j.cypher.internal.runtime.InternalExecutionResult import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments.Rows -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.util.InternalException import org.neo4j.graphalgo.impl.path.ShortestPath import org.neo4j.graphalgo.impl.path.ShortestPath.DataMonitor import org.neo4j.graphdb.factory.GraphDatabaseSettings diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/TimeZoneAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/TimeZoneAcceptanceTest.scala index 82cadb5617334..5937753528084 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/TimeZoneAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/TimeZoneAcceptanceTest.scala @@ -22,7 +22,7 @@ package org.neo4j.internal.cypher.acceptance import java.time.{ZoneId, ZonedDateTime} import org.neo4j.cypher._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.config.Setting import org.neo4j.graphdb.factory.GraphDatabaseSettings import org.neo4j.internal.cypher.acceptance.CypherComparisonSupport.Configs diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/VarLengthPlanningTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/VarLengthPlanningTest.scala index cabed062c927c..d2057b1d0c12a 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/VarLengthPlanningTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/VarLengthPlanningTest.scala @@ -22,7 +22,7 @@ package org.neo4j.internal.cypher.acceptance import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments import org.neo4j.cypher.internal.runtime.InternalExecutionResult import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription -import org.neo4j.cypher.internal.v3_5.expressions.NoneIterablePredicate +import org.opencypher.v9_0.expressions.NoneIterablePredicate import org.neo4j.cypher.{ExecutionEngineFunSuite, QueryStatisticsTestSupport} import org.neo4j.graphdb.Direction._ import org.neo4j.graphdb.{Direction, Node} diff --git a/enterprise/cypher/compatibility-spec-suite/LICENSES.txt b/enterprise/cypher/compatibility-spec-suite/LICENSES.txt index d001e1dab07c2..0f1d4aff21def 100644 --- a/enterprise/cypher/compatibility-spec-suite/LICENSES.txt +++ b/enterprise/cypher/compatibility-spec-suite/LICENSES.txt @@ -16,7 +16,13 @@ Apache Software License, Version 2.0 Lucene QueryParsers Netty/All-in-One opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting openCypher TCK Features and Graphs + openCypher Utils parboiled-core parboiled-scala ------------------------------------------------------------------------------ diff --git a/enterprise/cypher/compatibility-spec-suite/NOTICE.txt b/enterprise/cypher/compatibility-spec-suite/NOTICE.txt index 96ce8cb26e105..005a2e251741b 100644 --- a/enterprise/cypher/compatibility-spec-suite/NOTICE.txt +++ b/enterprise/cypher/compatibility-spec-suite/NOTICE.txt @@ -38,7 +38,13 @@ Apache Software License, Version 2.0 Lucene QueryParsers Netty/All-in-One opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting openCypher TCK Features and Graphs + openCypher Utils parboiled-core parboiled-scala diff --git a/enterprise/cypher/cypher/LICENSES.txt b/enterprise/cypher/cypher/LICENSES.txt index 5357fb0436b6f..ecc217cba42e8 100644 --- a/enterprise/cypher/cypher/LICENSES.txt +++ b/enterprise/cypher/cypher/LICENSES.txt @@ -16,6 +16,12 @@ Apache Software License, Version 2.0 Lucene QueryParsers Netty/All-in-One opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala ------------------------------------------------------------------------------ diff --git a/enterprise/cypher/cypher/NOTICE.txt b/enterprise/cypher/cypher/NOTICE.txt index dd858a830d6dc..1cf57484c5170 100644 --- a/enterprise/cypher/cypher/NOTICE.txt +++ b/enterprise/cypher/cypher/NOTICE.txt @@ -38,6 +38,12 @@ Apache Software License, Version 2.0 Lucene QueryParsers Netty/All-in-One opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala diff --git a/enterprise/cypher/cypher/pom.xml b/enterprise/cypher/cypher/pom.xml index d484754f6cafc..37669d6fcb4a8 100644 --- a/enterprise/cypher/cypher/pom.xml +++ b/enterprise/cypher/cypher/pom.xml @@ -178,17 +178,17 @@ - org.neo4j - openCypher-frontend-1 - ${project.version} + org.opencypher + ast-9.0 + ${openCypher.version} test-jar test - org.neo4j - neo4j-cypher-util-3.5 - ${project.version} + org.opencypher + util-9.0 + ${openCypher.version} test-jar test diff --git a/enterprise/cypher/cypher/src/main/java/org/neo4j/cypher/internal/codegen/QueryExecutionTracer.java b/enterprise/cypher/cypher/src/main/java/org/neo4j/cypher/internal/codegen/QueryExecutionTracer.java index 477a8aba3abfd..3009b5d9a57d4 100644 --- a/enterprise/cypher/cypher/src/main/java/org/neo4j/cypher/internal/codegen/QueryExecutionTracer.java +++ b/enterprise/cypher/cypher/src/main/java/org/neo4j/cypher/internal/codegen/QueryExecutionTracer.java @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.codegen; import org.neo4j.cypher.internal.runtime.compiled.codegen.QueryExecutionEvent; -import org.neo4j.cypher.internal.util.v3_5.attribution.Id; +import org.opencypher.v9_0.util.attribution.Id; public interface QueryExecutionTracer { diff --git a/enterprise/cypher/cypher/src/main/java/org/neo4j/cypher/internal/codegen/profiling/ProfilingTracer.java b/enterprise/cypher/cypher/src/main/java/org/neo4j/cypher/internal/codegen/profiling/ProfilingTracer.java index 3a65b46ed7376..0f7fd87d674f4 100644 --- a/enterprise/cypher/cypher/src/main/java/org/neo4j/cypher/internal/codegen/profiling/ProfilingTracer.java +++ b/enterprise/cypher/cypher/src/main/java/org/neo4j/cypher/internal/codegen/profiling/ProfilingTracer.java @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.runtime.compiled.codegen.QueryExecutionEvent; import org.neo4j.cypher.internal.planner.v3_5.spi.KernelStatisticProvider; -import org.neo4j.cypher.internal.util.v3_5.attribution.Id; +import org.opencypher.v9_0.util.attribution.Id; import org.neo4j.cypher.internal.codegen.QueryExecutionTracer; import org.neo4j.helpers.MathUtil; diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/BuildSlottedExecutionPlan.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/BuildSlottedExecutionPlan.scala index 6cff2981c32c3..4b189207dd860 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/BuildSlottedExecutionPlan.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/BuildSlottedExecutionPlan.scala @@ -24,10 +24,10 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime._ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.executionplan.{ExecutionPlan => RuntimeExecutionPlan, _} import org.neo4j.cypher.internal.compatibility.v3_5.runtime.phases.CompilationState import org.neo4j.cypher.internal.compiler.v3_5.phases.{CompilationContains, LogicalPlanState} -import org.neo4j.cypher.internal.frontend.v3_5.PlannerName -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.PIPE_BUILDING -import org.neo4j.cypher.internal.frontend.v3_5.phases.{CompilationPhaseTracer, Phase} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.frontend.PlannerName +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase.PIPE_BUILDING +import org.opencypher.v9_0.frontend.phases.{CompilationPhaseTracer, Phase} +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.planner.v3_5.spi.GraphStatistics import org.neo4j.cypher.internal.runtime.compiled.EnterpriseRuntimeContext import org.neo4j.cypher.internal.runtime.interpreted.commands.convert.{CommunityExpressionConverter, ExpressionConverters} @@ -35,7 +35,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, PipeExecutionB import org.neo4j.cypher.internal.runtime.slotted.expressions.SlottedExpressionConverters import org.neo4j.cypher.internal.runtime.slotted.{SlottedExecutionResultBuilderFactory, SlottedPipeBuilder} import org.neo4j.cypher.internal.runtime.{ExecutionMode, InternalExecutionResult, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.CypherException +import org.opencypher.v9_0.util.CypherException import org.neo4j.cypher.internal.v3_5.logical.plans.{IndexUsage, LogicalPlan} import org.neo4j.values.virtual.MapValue diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/BuildVectorizedExecutionPlan.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/BuildVectorizedExecutionPlan.scala index a30bd671a8d7f..8cf80161b14db 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/BuildVectorizedExecutionPlan.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/BuildVectorizedExecutionPlan.scala @@ -28,11 +28,10 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.helpers.InternalWrap import org.neo4j.cypher.internal.compatibility.v3_5.runtime.phases.CompilationState import org.neo4j.cypher.internal.compiler.v3_5.phases.LogicalPlanState import org.neo4j.cypher.internal.compiler.v3_5.planner.CantCompileQueryException -import org.neo4j.cypher.internal.frontend.v3_5.PlannerName -import org.neo4j.cypher.internal.frontend.v3_5.notification.ExperimentalFeatureNotification -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase -import org.neo4j.cypher.internal.frontend.v3_5.phases._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.frontend.PlannerName +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase +import org.opencypher.v9_0.frontend.phases._ +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.planner.v3_5.spi.GraphStatistics import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities import org.neo4j.cypher.internal.runtime.compiled.EnterpriseRuntimeContext @@ -44,7 +43,7 @@ import org.neo4j.cypher.internal.runtime.vectorized.dispatcher.{Dispatcher, Sing import org.neo4j.cypher.internal.runtime.vectorized.expressions.MorselExpressionConverters import org.neo4j.cypher.internal.runtime.vectorized.{Pipeline, PipelineBuilder} import org.neo4j.cypher.internal.runtime.{QueryStatistics, _} -import org.neo4j.cypher.internal.util.v3_5.TaskCloser +import org.opencypher.v9_0.util.{ExperimentalFeatureNotification, TaskCloser} import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan import org.neo4j.cypher.result.QueryResult.QueryResultVisitor import org.neo4j.graphdb._ diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/DebugPrettyPrinter.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/DebugPrettyPrinter.scala index a429fdbc5060e..a43efa3ca3fbf 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/DebugPrettyPrinter.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/DebugPrettyPrinter.scala @@ -23,8 +23,8 @@ import org.bitbucket.inkytonik.kiama.output.PrettyPrinter._ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.PhysicalPlanningAttributes.SlotConfigurations import org.neo4j.cypher.internal.compiler.v3_5.phases.LogicalPlanState import org.neo4j.cypher.internal.runtime.interpreted.pipes.Pipe -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.{CypherException, InternalException} +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.{CypherException, InternalException} import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan trait DebugPrettyPrinter { diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/EnterpriseRuntimeBuilder.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/EnterpriseRuntimeBuilder.scala index 0df8e9c1a8104..6cc8188cde52a 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/EnterpriseRuntimeBuilder.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/EnterpriseRuntimeBuilder.scala @@ -22,10 +22,9 @@ package org.neo4j.cypher.internal import org.neo4j.cypher.internal.compatibility.v3_5.runtime._ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.phases.CompilationState import org.neo4j.cypher.internal.compiler.v3_5.phases.LogicalPlanState -import org.neo4j.cypher.internal.frontend.v3_5.notification.RuntimeUnsupportedNotification -import org.neo4j.cypher.internal.frontend.v3_5.phases.{Do, If, Transformer} +import org.opencypher.v9_0.frontend.phases.{Do, If, Transformer} import org.neo4j.cypher.internal.runtime.compiled.{BuildCompiledExecutionPlan, EnterpriseRuntimeContext} -import org.neo4j.cypher.internal.util.v3_5.InvalidArgumentException +import org.opencypher.v9_0.util.{InvalidArgumentException, RuntimeUnsupportedNotification} import scala.util.{Failure, Success} diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/BuildCompiledExecutionPlan.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/BuildCompiledExecutionPlan.scala index 1fbefed28ffc8..dcf55cabe0497 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/BuildCompiledExecutionPlan.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/BuildCompiledExecutionPlan.scala @@ -27,15 +27,15 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.helpers.InternalWrap import org.neo4j.cypher.internal.compatibility.v3_5.runtime.phases.CompilationState import org.neo4j.cypher.internal.compiler.v3_5.phases.LogicalPlanState import org.neo4j.cypher.internal.compiler.v3_5.planner.CantCompileQueryException -import org.neo4j.cypher.internal.frontend.v3_5.PlannerName -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.CompilationPhase.CODE_GENERATION -import org.neo4j.cypher.internal.frontend.v3_5.phases.Phase +import org.opencypher.v9_0.frontend.PlannerName +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase.CODE_GENERATION +import org.opencypher.v9_0.frontend.phases.Phase import org.neo4j.cypher.internal.runtime._ import org.neo4j.cypher.internal.runtime.compiled.ExecutionPlanBuilder.DescriptionProvider import org.neo4j.cypher.internal.runtime.compiled.codegen.{CodeGenConfiguration, CodeGenerator} import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments -import org.neo4j.cypher.internal.util.v3_5.TaskCloser +import org.opencypher.v9_0.util.TaskCloser import org.neo4j.cypher.internal.v3_5.logical.plans.IndexUsage import org.neo4j.graphdb.Notification import org.neo4j.values.virtual.MapValue diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/CompiledExecutionResult.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/CompiledExecutionResult.scala index 1a7c9bd0b688e..1d706ff490b98 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/CompiledExecutionResult.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/CompiledExecutionResult.scala @@ -25,7 +25,7 @@ import org.neo4j.cypher.internal.executionplan.GeneratedQueryExecution import org.neo4j.cypher.internal.runtime._ import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments.{Runtime, RuntimeImpl} -import org.neo4j.cypher.internal.util.v3_5.{ProfilerStatisticsNotReadyException, TaskCloser} +import org.opencypher.v9_0.util.{ProfilerStatisticsNotReadyException, TaskCloser} import org.neo4j.cypher.result.QueryResult.QueryResultVisitor import org.neo4j.graphdb.Notification diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/CompiledRuntimeBuilder.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/CompiledRuntimeBuilder.scala index b339c95b42126..d4457bebccaf1 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/CompiledRuntimeBuilder.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/CompiledRuntimeBuilder.scala @@ -22,9 +22,8 @@ package org.neo4j.cypher.internal.runtime.compiled import org.neo4j.cypher.internal.compatibility.v3_5.runtime.phases.CompilationState import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{CompiledRuntimeName, _} import org.neo4j.cypher.internal.compiler.v3_5.phases.LogicalPlanState -import org.neo4j.cypher.internal.frontend.v3_5.notification.RuntimeUnsupportedNotification -import org.neo4j.cypher.internal.frontend.v3_5.phases.{Do, If, Transformer} -import org.neo4j.cypher.internal.util.v3_5.InvalidArgumentException +import org.opencypher.v9_0.frontend.phases.{Do, If, Transformer} +import org.opencypher.v9_0.util.{InvalidArgumentException, RuntimeUnsupportedNotification} class CompiledRuntimeBuilder extends RuntimeBuilder[Transformer[EnterpriseRuntimeContext, LogicalPlanState, CompilationState]] { diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/EnterpriseRuntimeContext.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/EnterpriseRuntimeContext.scala index b826bdd0f2e66..19871dd74deda 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/EnterpriseRuntimeContext.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/EnterpriseRuntimeContext.scala @@ -26,11 +26,11 @@ import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.CodeStructure import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{ExpressionEvaluator, Metrics, MetricsFactory, QueryGraphSolver} import org.neo4j.cypher.internal.compiler.v3_5.{ContextCreator, CypherCompilerConfiguration, SyntaxExceptionCreator, UpdateStrategy} import org.neo4j.cypher.internal.executionplan.GeneratedQuery -import org.neo4j.cypher.internal.frontend.v3_5.phases.{CompilationPhaseTracer, InternalNotificationLogger, Monitors} +import org.opencypher.v9_0.frontend.phases.{CompilationPhaseTracer, InternalNotificationLogger, Monitors} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanContext import org.neo4j.cypher.internal.runtime.vectorized.dispatcher.Dispatcher -import org.neo4j.cypher.internal.util.v3_5.attribution.IdGen -import org.neo4j.cypher.internal.util.v3_5.{CypherException, InputPosition} +import org.opencypher.v9_0.util.attribution.IdGen +import org.opencypher.v9_0.util.{CypherException, InputPosition} class EnterpriseRuntimeContext(override val exceptionCreator: (String, InputPosition) => CypherException, override val tracer: CompilationPhaseTracer, diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/ExecutionPlanBuilder.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/ExecutionPlanBuilder.scala index 5a25244c9f65a..a337a8e275ff9 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/ExecutionPlanBuilder.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/ExecutionPlanBuilder.scala @@ -24,12 +24,12 @@ import org.neo4j.cypher.internal.codegen.QueryExecutionTracer import org.neo4j.cypher.internal.codegen.profiling.ProfilingTracer import org.neo4j.cypher.internal.compatibility.v3_5.runtime.executionplan.{PeriodicCommitInfo, Provider} import org.neo4j.cypher.internal.compatibility.v3_5.runtime.CompiledRuntimeName -import org.neo4j.cypher.internal.frontend.v3_5.PlannerName +import org.opencypher.v9_0.frontend.PlannerName import org.neo4j.cypher.internal.runtime.compiled.ExecutionPlanBuilder.DescriptionProvider import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments import org.neo4j.cypher.internal.runtime.{ExecutionMode, InternalExecutionResult, ProfileMode, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.TaskCloser +import org.opencypher.v9_0.util.TaskCloser import org.neo4j.cypher.internal.v3_5.logical.plans.IndexUsage import org.neo4j.values.virtual.MapValue diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/CodeGenConfiguration.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/CodeGenConfiguration.scala index 27959156fb375..16a3f77afa2dc 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/CodeGenConfiguration.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/CodeGenConfiguration.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.compiled.codegen import java.nio.file.{Path, Paths} -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.util.InternalException /** * Configuration modes for code generation diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/CodeGenContext.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/CodeGenContext.scala index 0c193502cd495..881c5e5e4bd1c 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/CodeGenContext.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/CodeGenContext.scala @@ -23,8 +23,8 @@ import org.neo4j.cypher.InternalException import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.JoinData import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions.CodeGenType import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.ast.semantics.SemanticTable +import org.opencypher.v9_0.util.attribution.Id import scala.collection.mutable diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/CodeGenerator.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/CodeGenerator.scala index 4472f990c018a..46c6ac8556861 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/CodeGenerator.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/CodeGenerator.scala @@ -28,8 +28,8 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.CompiledRuntimeName import org.neo4j.cypher.internal.compatibility.v3_5.runtime.executionplan.Provider import org.neo4j.cypher.internal.compiler.v3_5.planner.CantCompileQueryException import org.neo4j.cypher.internal.executionplan.{GeneratedQuery, GeneratedQueryExecution} -import org.neo4j.cypher.internal.frontend.v3_5.PlannerName -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.frontend.PlannerName +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities import org.neo4j.cypher.internal.planner.v3_5.spi.{InstrumentedGraphStatistics, PlanContext} import org.neo4j.cypher.internal.runtime.compiled.ExecutionPlanBuilder.DescriptionProvider @@ -39,8 +39,8 @@ import org.neo4j.cypher.internal.runtime.compiled.{CompiledExecutionResult, Comp import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments.{Runtime, RuntimeImpl} import org.neo4j.cypher.internal.runtime.planDescription.{InternalPlanDescription, LogicalPlan2PlanDescription} import org.neo4j.cypher.internal.runtime.{ExecutionMode, InternalExecutionResult, QueryContext, compiled} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.{Eagerly, TaskCloser} +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.{Eagerly, TaskCloser} import org.neo4j.cypher.internal.v3_5.logical.plans.{LogicalPlan, ProduceResult} import org.neo4j.values.virtual.MapValue diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/LogicalPlanConverter.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/LogicalPlanConverter.scala index 305866bebecb2..c45b7105332cd 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/LogicalPlanConverter.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/LogicalPlanConverter.scala @@ -19,24 +19,26 @@ */ package org.neo4j.cypher.internal.runtime.compiled.codegen +import org.neo4j.cypher.internal.compiler.v3_5.planner.CantCompileQueryException +import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities import org.neo4j.cypher.internal.runtime.compiled.codegen.ir._ import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.aggregation.AggregationConverter.aggregateExpressionConverter import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.aggregation.Distinct import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions.ExpressionConverter.createExpression import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions._ import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.SortItem -import org.neo4j.cypher.internal.compiler.v3_5.planner.CantCompileQueryException -import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.Cardinalities -import org.neo4j.cypher.internal.util.v3_5.Eagerly.immutableMapValues -import org.neo4j.cypher.internal.util.v3_5.Foldable._ -import org.neo4j.cypher.internal.util.v3_5.{InternalException, One, ZeroOneOrMany, symbols} -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, FunctionInvocation} import org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.v3_5.logical.plans.ColumnOrder -import org.neo4j.cypher.internal.v3_5.{expressions => ast, functions => ast_functions} +import org.opencypher.v9_0.expressions.{Expression, FunctionInvocation, functions => ast_functions} +import org.opencypher.v9_0.util.Eagerly.immutableMapValues +import org.opencypher.v9_0.util.Foldable._ +import org.opencypher.v9_0.util.{InternalException, One, ZeroOneOrMany, symbols} +import org.opencypher.v9_0.{expressions => ast} object LogicalPlanConverter { + private type IndexSeekFun = (String, String, CodeGenExpression, Variable, Instruction) => Instruction + def asCodeGenPlan(logicalPlan: plans.LogicalPlan): CodeGenPlan = logicalPlan match { case p: plans.Argument => argumentAsCodeGenPlan(p) case p: plans.AllNodesScan => allNodesScanAsCodeGenPlan(p) @@ -87,7 +89,7 @@ object LogicalPlanConverter { case _: plans.Top => true } - private def hasStandaloneLimit(p: plans.LogicalPlan)= p.treeExists { + private def hasStandaloneLimit(p: plans.LogicalPlan) = p.treeExists { case _: plans.Limit => true } @@ -108,7 +110,7 @@ object LogicalPlanConverter { override def consume(context: CodeGenContext, child: CodeGenPlan, cardinalities: Cardinalities) = { val projectionOpName = context.registerOperator(projection) val columns = immutableMapValues(projection.expressions, - (e: ast.Expression) => ExpressionConverter.createExpression(e)(context)) + (e: ast.Expression) => ExpressionConverter.createExpression(e)(context)) context.retainProjectedVariables(projection.expressions.keySet) val vars = columns.collect { case (name, expr) if !context.hasVariable(name) => @@ -143,8 +145,8 @@ object LogicalPlanConverter { override def consume(context: CodeGenContext, child: CodeGenPlan, cardinalities: Cardinalities) = { val produceResultOpName = context.registerOperator(produceResults) val projections = produceResults.columns.map(c => - c -> ExpressionConverter - .createMaterializeExpressionForVariable(c)(context)).toMap + c -> ExpressionConverter + .createMaterializeExpressionForVariable(c)(context)).toMap (None, List(AcceptVisitor(produceResultOpName, projections))) } @@ -175,8 +177,6 @@ object LogicalPlanConverter { } } - private type IndexSeekFun = (String, String, CodeGenExpression, Variable, Instruction) => Instruction - // Used by both nodeIndexSeekAsCodeGenPlan and nodeUniqueIndexSeekAsCodeGenPlan private def sharedIndexSeekAsCodeGenPlan(indexSeekFun: IndexSeekFun) (idName: String, valueExpr: plans.QueryExpression[Expression], @@ -202,8 +202,8 @@ object LogicalPlanConverter { val expression = ToSet(createExpression(e)(context)) val expressionVar = Variable(context.namer.newVarName(), CodeGenType.Any, nullable = false) ForEachExpression(expressionVar, expression, - indexSeekFun(opName, context.namer.newVarName(), LoadVariable(expressionVar), nodeVar, - actions)) + indexSeekFun(opName, context.namer.newVarName(), LoadVariable(expressionVar), nodeVar, + actions)) //collection used in composite index search, pass entire collection to index seek case plans.CompositeQueryExpression(e: ast.ListLiteral) => @@ -229,24 +229,24 @@ object LogicalPlanConverter { val opName = context.registerOperator(logicalPlan) val seekOperation = seek.nodeIds match { case plans.SingleSeekableArg(e) => SeekNodeById(opName, nodeVar, - createExpression(e)(context), actions) + createExpression(e)(context), actions) case plans.ManySeekableArgs(e) => e match { case coll: ast.ListLiteral => ZeroOneOrMany(coll.expressions) match { case One(value) => SeekNodeById(opName, nodeVar, - createExpression(value)(context), actions) + createExpression(value)(context), actions) case _ => val expression = createExpression(e)(context) val expressionVar = Variable(context.namer.newVarName(), CodeGenType.Any, nullable = false) ForEachExpression(expressionVar, expression, - SeekNodeById(opName, nodeVar, LoadVariable(expressionVar), actions)) + SeekNodeById(opName, nodeVar, LoadVariable(expressionVar), actions)) } case exp => val expression = ToSet(createExpression(exp)(context)) val expressionVar = Variable(context.namer.newVarName(), CodeGenType.Any, nullable = false) ForEachExpression(expressionVar, expression, - SeekNodeById(opName, nodeVar, LoadVariable(expressionVar), actions)) + SeekNodeById(opName, nodeVar, LoadVariable(expressionVar), actions)) } } (methodHandle, seekOperation :: tl) @@ -257,7 +257,7 @@ object LogicalPlanConverter { def indexSeekFun(opName: String, descriptorVar: String, expression: CodeGenExpression, nodeVar: Variable, actions: Instruction) = WhileLoop(nodeVar, IndexSeek(opName, indexSeek.label.name, indexSeek.propertyKeys.map(_.name), - descriptorVar, expression), actions) + descriptorVar, expression), actions) sharedIndexSeekAsCodeGenPlan(indexSeekFun)(indexSeek.idName, indexSeek.valueExpr, indexSeek) } @@ -266,7 +266,7 @@ object LogicalPlanConverter { def indexSeekFun(opName: String, descriptorVar: String, expression: CodeGenExpression, nodeVar: Variable, actions: Instruction) = WhileLoop(nodeVar, IndexSeek(opName, indexSeek.label.name, indexSeek.propertyKeys.map(_.name), - descriptorVar, expression), actions) + descriptorVar, expression), actions) sharedIndexSeekAsCodeGenPlan(indexSeekFun)(indexSeek.idName, indexSeek.valueExpr, indexSeek) } @@ -347,7 +347,7 @@ object LogicalPlanConverter { val typeVar2TypeName = expand.types.map(t => context.namer.newVarName() -> t.name).toMap val opName = context.registerOperator(expand) val expandGenerator = ExpandAllLoopDataGenerator(opName, fromNodeVar, expand.dir, typeVar2TypeName, toNodeVar, - relVar) + relVar) (methodHandle, WhileLoop(relVar, expandGenerator, action) :: tl) } @@ -364,7 +364,7 @@ object LogicalPlanConverter { val typeVar2TypeName = expand.types.map(t => context.namer.newVarName() -> t.name).toMap val opName = context.registerOperator(expand) val expandGenerator = ExpandIntoLoopDataGenerator(opName, fromNodeVar, expand.dir, typeVar2TypeName, toNodeVar, - relVar) + relVar) (methodHandle, WhileLoop(relVar, expandGenerator, action) :: tl) } @@ -554,7 +554,7 @@ object LogicalPlanConverter { val endLabel = relCount.endLabel.map(l => context.semanticTable.id(l).map(_.id) -> l.name) val types = relCount.typeNames.map(t => context.semanticTable.id(t).map(_.id) -> t.name) (methodHandle, RelationshipCountFromCountStoreInstruction(opName, variable, startLabel, types, endLabel, - actions) :: tl) + actions) :: tl) } } diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/ExpandAllLoopDataGenerator.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/ExpandAllLoopDataGenerator.scala index 5fb1a1a12f2a5..73ccc8a3515af 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/ExpandAllLoopDataGenerator.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/ExpandAllLoopDataGenerator.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.MethodStructure import org.neo4j.cypher.internal.runtime.compiled.codegen.{CodeGenContext, Variable} -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection case class ExpandAllLoopDataGenerator(opName: String, fromVar: Variable, dir: SemanticDirection, types: Map[String, String], toVar: Variable, relVar: Variable) diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/ExpandIntoLoopDataGenerator.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/ExpandIntoLoopDataGenerator.scala index 42da6a96954e9..e0d6edb2fd89b 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/ExpandIntoLoopDataGenerator.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/ExpandIntoLoopDataGenerator.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.MethodStructure import org.neo4j.cypher.internal.runtime.compiled.codegen.{CodeGenContext, Variable} -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection case class ExpandIntoLoopDataGenerator(opName: String, fromVar: Variable, dir: SemanticDirection, types: Map[String, String], toVar: Variable, relVar: Variable) diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/UnwindPrimitiveCollection.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/UnwindPrimitiveCollection.scala index ffae8de0a232b..eefa1986d2d7c 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/UnwindPrimitiveCollection.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/UnwindPrimitiveCollection.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions.{CodeGenExpression, CodeGenType, CypherCodeGenType, ListReferenceType} import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.MethodStructure import org.neo4j.cypher.internal.runtime.compiled.codegen.{CodeGenContext, Variable} -import org.neo4j.cypher.internal.util.v3_5.symbols +import org.opencypher.v9_0.util.symbols case class UnwindPrimitiveCollection(opName: String, collection: CodeGenExpression) extends LoopDataGenerator { override def init[E](generator: MethodStructure[E])(implicit context: CodeGenContext): Unit = diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/aggregation/AggregationConverter.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/aggregation/AggregationConverter.scala index bc8c73a83e397..f336c6382044b 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/aggregation/AggregationConverter.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/aggregation/AggregationConverter.scala @@ -23,8 +23,8 @@ import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions.Express import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions.{CodeGenExpression, CodeGenType} import org.neo4j.cypher.internal.runtime.compiled.codegen.{CodeGenContext, Variable} import org.neo4j.cypher.internal.compiler.v3_5.planner.CantCompileQueryException -import org.neo4j.cypher.internal.v3_5.{expressions => ast} -import org.neo4j.cypher.internal.v3_5.{functions => astFunctions} +import org.opencypher.v9_0.{expressions => ast} +import org.opencypher.v9_0.expressions.{functions => astFunctions} /* * Conversion methods for aggregation functions diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/Addition.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/Addition.scala index 31b75265664aa..3a7ef57e282ac 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/Addition.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/Addition.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions import org.neo4j.cypher.internal.runtime.compiled.codegen.CodeGenContext import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.MethodStructure -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ case class Addition(lhs: CodeGenExpression, rhs: CodeGenExpression) extends CodeGenExpression with BinaryOperator { diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/AnyProjection.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/AnyProjection.scala index 823a2c666e521..6129d34b4c85e 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/AnyProjection.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/AnyProjection.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.util.InternalException import org.neo4j.cypher.internal.runtime.compiled.codegen._ import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.MethodStructure diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/BinaryOperator.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/BinaryOperator.scala index 01d34d7000a8c..328c80ad855ae 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/BinaryOperator.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/BinaryOperator.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions -import org.neo4j.cypher.internal.util.v3_5.CypherTypeException +import org.opencypher.v9_0.util.CypherTypeException import org.neo4j.cypher.internal.runtime.compiled.codegen.CodeGenContext import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.MethodStructure -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ trait BinaryOperator { self: CodeGenExpression => diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/CodeGenType.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/CodeGenType.scala index 14a00328b1b11..787a387adad8b 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/CodeGenType.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/CodeGenType.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ trait CodeGenType { def isPrimitive: Boolean diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/Equals.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/Equals.scala index 1e7a8a62d2dad..f4efebaf2bae8 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/Equals.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/Equals.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions -import org.neo4j.cypher.internal.util.v3_5.IncomparableValuesException +import org.opencypher.v9_0.util.IncomparableValuesException import org.neo4j.cypher.internal.runtime.compiled.codegen.CodeGenContext import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.MethodStructure -import org.neo4j.cypher.internal.util.v3_5.symbols.{CTBoolean, CTMap, ListType} -import org.neo4j.cypher.internal.util.v3_5.symbols +import org.opencypher.v9_0.util.symbols.{CTBoolean, CTMap, ListType} +import org.opencypher.v9_0.util.symbols case class Equals(lhs: CodeGenExpression, rhs: CodeGenExpression) extends CodeGenExpression { diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/ExpressionConverter.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/ExpressionConverter.scala index 3435c898cf5fc..2ddd2cfe65a1e 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/ExpressionConverter.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/ExpressionConverter.scala @@ -25,8 +25,8 @@ import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.functions.functionC import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.MethodStructure import org.neo4j.cypher.internal.compiler.v3_5.planner.CantCompileQueryException import org.neo4j.cypher.internal.runtime.compiled.helpers.LiteralTypeSupport -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.{expressions => ast} +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.{expressions => ast} object ExpressionConverter { diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/HasLabel.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/HasLabel.scala index 9589b5ab4f16b..fb4dcb534ec1e 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/HasLabel.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/HasLabel.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.MethodStructure import org.neo4j.cypher.internal.runtime.compiled.codegen.{CodeGenContext, Variable} -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ case class HasLabel(nodeVariable: Variable, labelVariable: String, labelName: String) extends CodeGenExpression { diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/IdOf.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/IdOf.scala index 005ae29ed5df7..67542b7821e4a 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/IdOf.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/IdOf.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.MethodStructure import org.neo4j.cypher.internal.runtime.compiled.codegen.{CodeGenContext, Variable} -import org.neo4j.cypher.internal.util.v3_5.symbols +import org.opencypher.v9_0.util.symbols case class IdOf(variable: Variable) extends CodeGenExpression { diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/ListLiteral.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/ListLiteral.scala index 6c5f72447c0d8..e32ac880f702e 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/ListLiteral.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/ListLiteral.scala @@ -22,8 +22,8 @@ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions import org.neo4j.cypher.internal.runtime.compiled.codegen.CodeGenContext import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.MethodStructure import org.neo4j.cypher.internal.runtime.compiled.helpers.LiteralTypeSupport -import org.neo4j.cypher.internal.util.v3_5.symbols -import org.neo4j.cypher.internal.util.v3_5.symbols.ListType +import org.opencypher.v9_0.util.symbols +import org.opencypher.v9_0.util.symbols.ListType case class ListLiteral(expressions: Seq[CodeGenExpression]) extends CodeGenExpression { diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/LoadVariable.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/LoadVariable.scala index 70eed28591bfe..bf0edbc3314ed 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/LoadVariable.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/LoadVariable.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.util.InternalException import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.MethodStructure import org.neo4j.cypher.internal.runtime.compiled.codegen.{CodeGenContext, Variable} diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/Modulo.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/Modulo.scala index 9c2113e7a21f4..261f4ceed7271 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/Modulo.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/Modulo.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions import org.neo4j.cypher.internal.runtime.compiled.codegen.CodeGenContext import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.MethodStructure -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ case class Modulo(lhs: CodeGenExpression, rhs: CodeGenExpression) extends CodeGenExpression with BinaryOperator { diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/MyMap.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/MyMap.scala index 76029881b68a3..15a5f3c8b372a 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/MyMap.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/MyMap.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions import org.neo4j.cypher.internal.runtime.compiled.codegen.CodeGenContext import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.MethodStructure -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ //Named MyMap to avoid conflict with collection.Map which makes everything weird case class MyMap(instructions: Map[String, CodeGenExpression]) extends CodeGenExpression { diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/NodeProjection.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/NodeProjection.scala index 450e904b9f06e..a12feb00909a7 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/NodeProjection.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/NodeProjection.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.MethodStructure import org.neo4j.cypher.internal.runtime.compiled.codegen.{CodeGenContext, Variable} -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ case class NodeProjection(nodeIdVar: Variable) extends CodeGenExpression { diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/Not.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/Not.scala index 8892220babe5d..108dc84fffc32 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/Not.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/Not.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions import org.neo4j.cypher.internal.runtime.compiled.codegen.CodeGenContext import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.MethodStructure -import org.neo4j.cypher.internal.util.v3_5.symbols.CTBoolean +import org.opencypher.v9_0.util.symbols.CTBoolean case class Not(inner: CodeGenExpression) extends CodeGenExpression { diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/Or.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/Or.scala index b998c7882c59f..62ff2d18d337a 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/Or.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/Or.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions import org.neo4j.cypher.internal.runtime.compiled.codegen.CodeGenContext import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.MethodStructure -import org.neo4j.cypher.internal.util.v3_5.symbols.CTBoolean +import org.opencypher.v9_0.util.symbols.CTBoolean case class Or(lhs: CodeGenExpression, rhs: CodeGenExpression) extends CodeGenExpression { diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/RelationshipProjection.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/RelationshipProjection.scala index d33c6c8ae4690..db04721d75fc9 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/RelationshipProjection.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/RelationshipProjection.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.MethodStructure import org.neo4j.cypher.internal.runtime.compiled.codegen.{CodeGenContext, Variable} -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ case class RelationshipProjection(relId: Variable) extends CodeGenExpression { assert(relId.codeGenType.asInstanceOf[CypherCodeGenType].ct == CTRelationship) diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/TypeOf.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/TypeOf.scala index 3c5f783ade620..b022342342b68 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/TypeOf.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/expressions/TypeOf.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.MethodStructure import org.neo4j.cypher.internal.runtime.compiled.codegen.{CodeGenContext, Variable} -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ case class TypeOf(relId: Variable) extends CodeGenExpression { diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/functions/CodeGenFunction1.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/functions/CodeGenFunction1.scala index 689b97c4a1dd6..11ed83891ed22 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/functions/CodeGenFunction1.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/functions/CodeGenFunction1.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir.functions -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.util.InternalException import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions._ sealed trait CodeGenFunction1 { diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/functions/functionConverter.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/functions/functionConverter.scala index f4e21ab27b5a9..5111e77996c58 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/functions/functionConverter.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/ir/functions/functionConverter.scala @@ -22,8 +22,8 @@ package org.neo4j.cypher.internal.runtime.compiled.codegen.ir.functions import org.neo4j.cypher.internal.runtime.compiled.codegen.CodeGenContext import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions._ import org.neo4j.cypher.internal.compiler.v3_5.planner.CantCompileQueryException -import org.neo4j.cypher.internal.v3_5.{expressions => ast} -import org.neo4j.cypher.internal.v3_5.{functions => astFunctions} +import org.opencypher.v9_0.{expressions => ast} +import org.opencypher.v9_0.expressions.{functions => astFunctions} object functionConverter { diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/spi/CodeStructure.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/spi/CodeStructure.scala index 32be959d788e8..8b64e5ca441e7 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/spi/CodeStructure.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/spi/CodeStructure.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.compiled.codegen.spi import org.neo4j.cypher.internal.runtime.compiled.codegen.{CodeGenConfiguration, CodeGenContext} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id /** * This constitutes the SPI for code generation. diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/spi/MethodStructure.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/spi/MethodStructure.scala index 6ac864d66273d..281c995957423 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/spi/MethodStructure.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/codegen/spi/MethodStructure.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.compiled.codegen.spi import org.neo4j.cypher.internal.runtime.compiled.codegen.Variable import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions.CodeGenType -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.values.AnyValue /** diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/helpers/LiteralTypeSupport.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/helpers/LiteralTypeSupport.scala index 52c87003eb6b1..77c5a3fdda066 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/helpers/LiteralTypeSupport.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/runtime/compiled/helpers/LiteralTypeSupport.scala @@ -23,7 +23,7 @@ import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions.{AnyValueType, BoolType, CypherCodeGenType, ListReferenceType, LongType, ReferenceType, RepresentationType, ValueType} import org.neo4j.cypher.internal.compiler.v3_5.helpers.IsList import org.neo4j.cypher.internal.runtime.interpreted.IsMap -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.util.symbols._ object LiteralTypeSupport { def deriveCypherType(obj: Any): CypherType = obj match { diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/spi/codegen/AuxGenerator.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/spi/codegen/AuxGenerator.scala index 8f3194c94b3c8..3f0f4081ddffd 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/spi/codegen/AuxGenerator.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/spi/codegen/AuxGenerator.scala @@ -29,8 +29,8 @@ import org.neo4j.cypher.internal.runtime.compiled.codegen.CodeGenContext import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions._ import org.neo4j.cypher.internal.runtime.compiled.codegen.spi._ import org.neo4j.cypher.internal.compiler.v3_5.common.CypherOrderability -import org.neo4j.cypher.internal.frontend.v3_5.helpers._ -import org.neo4j.cypher.internal.util.v3_5.symbols +import org.opencypher.v9_0.frontend.helpers._ +import org.opencypher.v9_0.util.symbols import org.neo4j.values.AnyValue import org.neo4j.values.storable.Value diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/spi/codegen/GeneratedMethodStructure.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/spi/codegen/GeneratedMethodStructure.scala index df0306ad41cc5..a91291909b284 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/spi/codegen/GeneratedMethodStructure.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/spi/codegen/GeneratedMethodStructure.scala @@ -31,7 +31,7 @@ import org.neo4j.codegen.MethodReference.methodReference import org.neo4j.codegen._ import org.neo4j.cypher.internal.codegen.CompiledConversionUtils.CompositeKey import org.neo4j.cypher.internal.codegen._ -import org.neo4j.cypher.internal.frontend.v3_5.helpers._ +import org.opencypher.v9_0.frontend.helpers._ import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions.{AnyValueType, BoolType, CodeGenType, CypherCodeGenType, FloatType, ListReferenceType, LongType, ReferenceType, RepresentationType, Parameter => _} import org.neo4j.cypher.internal.runtime.compiled.codegen.spi._ import org.neo4j.cypher.internal.runtime.compiled.codegen.{CodeGenContext, QueryExecutionEvent} @@ -39,10 +39,10 @@ import org.neo4j.cypher.internal.spi.codegen.GeneratedMethodStructure.Completabl import org.neo4j.cypher.internal.spi.codegen.GeneratedQueryStructure._ import org.neo4j.cypher.internal.spi.codegen.Methods._ import org.neo4j.cypher.internal.spi.codegen.Templates._ -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.symbols.{CTInteger, CTNode, CTRelationship, ListType} -import org.neo4j.cypher.internal.util.v3_5.{ParameterNotFoundException, symbols} -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.symbols.{CTInteger, CTNode, CTRelationship, ListType} +import org.opencypher.v9_0.util.{ParameterNotFoundException, symbols} +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.graphdb.Direction import org.neo4j.internal.kernel.api._ import org.neo4j.internal.kernel.api.helpers.RelationshipSelectionCursor diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/spi/codegen/GeneratedQueryStructure.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/spi/codegen/GeneratedQueryStructure.scala index 037d2ccbddc09..aa73d5da0a8d0 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/spi/codegen/GeneratedQueryStructure.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/spi/codegen/GeneratedQueryStructure.scala @@ -32,15 +32,15 @@ import org.neo4j.codegen.{CodeGenerator, Parameter, TypeReference, _} import org.neo4j.cypher.internal.codegen.{PrimitiveNodeStream, PrimitiveRelationshipStream, QueryExecutionTracer} import org.neo4j.cypher.internal.compatibility.v3_5.runtime.executionplan.{Completable, Provider} import org.neo4j.cypher.internal.executionplan.{GeneratedQuery, GeneratedQueryExecution} -import org.neo4j.cypher.internal.frontend.v3_5.helpers.using +import org.opencypher.v9_0.frontend.helpers.using import org.neo4j.cypher.internal.javacompat.ResultRecord import org.neo4j.cypher.internal.runtime.compiled.codegen._ import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions._ import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.{CodeStructure, CodeStructureResult, MethodStructure} import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription import org.neo4j.cypher.internal.runtime.{ExecutionMode, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.symbols +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.symbols import org.neo4j.cypher.result.QueryResult.QueryResultVisitor import org.neo4j.internal.kernel.api._ import org.neo4j.kernel.impl.core.EmbeddedProxySPI diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/spi/codegen/Methods.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/spi/codegen/Methods.scala index 879886423fdc4..cf0ce69d87053 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/spi/codegen/Methods.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/spi/codegen/Methods.scala @@ -28,7 +28,7 @@ import org.neo4j.cypher.internal.codegen.CompiledConversionUtils.CompositeKey import org.neo4j.cypher.internal.codegen._ import org.neo4j.cypher.internal.runtime.compiled.codegen.QueryExecutionEvent import org.neo4j.cypher.internal.javacompat.ResultRecord -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.cypher.result.QueryResult.{QueryResultVisitor, Record} import org.neo4j.graphdb.Direction import org.neo4j.helpers.collection.MapUtil diff --git a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/spi/codegen/Templates.scala b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/spi/codegen/Templates.scala index 5522e65478493..8111dffd25323 100644 --- a/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/spi/codegen/Templates.scala +++ b/enterprise/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/spi/codegen/Templates.scala @@ -31,12 +31,12 @@ import org.neo4j.codegen.MethodReference._ import org.neo4j.codegen._ import org.neo4j.cypher.internal.codegen.{PrimitiveNodeStream, PrimitiveRelationshipStream, QueryExecutionTracer} import org.neo4j.cypher.internal.compatibility.v3_5.runtime.executionplan.{Completable, Provider} -import org.neo4j.cypher.internal.frontend.v3_5.helpers.using +import org.opencypher.v9_0.frontend.helpers.using import org.neo4j.cypher.internal.javacompat.ResultRowImpl import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription import org.neo4j.cypher.internal.runtime.{ExecutionMode, QueryContext, QueryTransactionalContext} import org.neo4j.cypher.internal.spi.codegen.Methods.{newNodeProxyById, newRelationshipProxyById} -import org.neo4j.cypher.internal.util.v3_5.CypherExecutionException +import org.opencypher.v9_0.util.CypherExecutionException import org.neo4j.graphdb.{Direction, Node, Relationship} import org.neo4j.internal.kernel.api._ import org.neo4j.internal.kernel.api.exceptions.{EntityNotFoundException, KernelException} diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/CloseTransactionTest.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/CloseTransactionTest.scala index 7db2cdf995c0c..2059c7cdbd763 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/CloseTransactionTest.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/CloseTransactionTest.scala @@ -25,7 +25,7 @@ import org.neo4j.collection.RawIterator import org.neo4j.cypher.ExecutionEngineHelper.createEngine import org.neo4j.cypher.internal.ExecutionEngine import org.neo4j.cypher.internal.javacompat.GraphDatabaseCypherService -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.Result.{ResultRow, ResultVisitor} import org.neo4j.graphdb.{GraphDatabaseService, Result} import org.neo4j.internal.kernel.api.exceptions.ProcedureException diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/ExecutionEngineIT.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/ExecutionEngineIT.scala index 69a5d0ced1d56..1d1ce5836bd39 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/ExecutionEngineIT.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/ExecutionEngineIT.scala @@ -24,7 +24,7 @@ import java.util import org.neo4j.collection.RawIterator import org.neo4j.cypher.internal.ExecutionEngine import org.neo4j.cypher.internal.javacompat.GraphDatabaseCypherService -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.Result.{ResultRow, ResultVisitor} import org.neo4j.graphdb.{ExecutionPlanDescription, Result} import org.neo4j.internal.kernel.api.exceptions.ProcedureException diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/RootPlanAcceptanceTest.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/RootPlanAcceptanceTest.scala index 2e6ea1c37c7ff..38b1faece2035 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/RootPlanAcceptanceTest.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/RootPlanAcceptanceTest.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{CompiledRuntimeName, InterpretedRuntimeName, RuntimeName, SlottedRuntimeName} import org.neo4j.cypher.internal.compiler.v3_5._ -import org.neo4j.cypher.internal.frontend.v3_5.PlannerName +import org.opencypher.v9_0.frontend.PlannerName import org.neo4j.cypher.internal.planner.v3_5.spi.{CostBasedPlannerName, DPPlannerName, IDPPlannerName} import org.neo4j.graphdb.ExecutionPlanDescription import org.neo4j.values.virtual.VirtualValues diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/codegen/profiling/ProfilingTracerTest.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/codegen/profiling/ProfilingTracerTest.scala index 75bc1592146cf..713af470b09ce 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/codegen/profiling/ProfilingTracerTest.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/codegen/profiling/ProfilingTracerTest.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.codegen.profiling import org.neo4j.cypher.internal.planner.v3_5.spi.{EmptyKernelStatisticProvider, KernelStatisticProvider} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.io.pagecache.tracing.cursor.DefaultPageCursorTracer class ProfilingTracerTest extends CypherFunSuite { diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/BTTest.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/BTTest.scala index 85540aa57bc21..20f10ed423b26 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/BTTest.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/BTTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.queryReduction -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class BTTest extends CypherFunSuite with ReductionTestHelper { diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/CypherReductionSupport.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/CypherReductionSupport.scala index 847dc8950cc3d..4c53d48850e54 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/CypherReductionSupport.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/CypherReductionSupport.scala @@ -28,13 +28,6 @@ import org.neo4j.cypher.internal.compiler.v3_5._ import org.neo4j.cypher.internal.compiler.v3_5.phases.{CompilationContains, LogicalPlanState} import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.idp.{IDPQueryGraphSolver, IDPQueryGraphSolverMonitor, SingleComponentPlanner, cartesianProductsOrValueJoins} import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{CachedMetricsFactory, SimpleMetricsFactory} -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast.rewriters.{ASTRewriter, Never} -import org.neo4j.cypher.internal.frontend.v3_5.helpers.rewriting.RewriterStepSequencer -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.NO_TRACING -import org.neo4j.cypher.internal.frontend.v3_5.phases._ -import org.neo4j.cypher.internal.frontend.v3_5.prettifier.{ExpressionStringifier, Prettifier} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticState import org.neo4j.cypher.internal.javacompat.GraphDatabaseCypherService import org.neo4j.cypher.internal.planner.v3_5.spi.PlanningAttributes.{Cardinalities, Solveds} import org.neo4j.cypher.internal.planner.v3_5.spi.{IDPPlannerName, PlanContext, PlannerNameFor} @@ -45,8 +38,6 @@ import org.neo4j.cypher.internal.runtime.interpreted.{TransactionBoundPlanContex import org.neo4j.cypher.internal.runtime.vectorized.dispatcher.SingleThreadedExecutor import org.neo4j.cypher.internal.runtime.{InternalExecutionResult, NormalMode} import org.neo4j.cypher.internal.spi.codegen.GeneratedQueryStructure -import org.neo4j.cypher.internal.util.v3_5.attribution.SequentialIdGen -import org.neo4j.cypher.internal.util.v3_5.test_helpers.{CypherFunSuite, CypherTestSupport} import org.neo4j.cypher.internal.{CompilerEngineDelegator, ExecutionPlan, RewindableExecutionResult} import org.neo4j.internal.kernel.api.Transaction import org.neo4j.internal.kernel.api.security.LoginContext @@ -56,6 +47,15 @@ import org.neo4j.kernel.impl.query.{Neo4jTransactionalContextFactory, Transactio import org.neo4j.kernel.monitoring.Monitors import org.neo4j.test.TestGraphDatabaseFactory import org.neo4j.values.virtual.VirtualValues.EMPTY_MAP +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.ast.semantics.SemanticState +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.NO_TRACING +import org.opencypher.v9_0.frontend.phases._ +import org.opencypher.v9_0.frontend.prettifier.{ExpressionStringifier, Prettifier} +import org.opencypher.v9_0.rewriting.RewriterStepSequencer +import org.opencypher.v9_0.rewriting.rewriters.Never +import org.opencypher.v9_0.util.attribution.SequentialIdGen +import org.opencypher.v9_0.util.test_helpers.{CypherFunSuite, CypherTestSupport} import scala.util.Try diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/CypherReductionSupportTest.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/CypherReductionSupportTest.scala index 7e6088ba715b5..5a1522e417b37 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/CypherReductionSupportTest.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/CypherReductionSupportTest.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.queryReduction import org.neo4j.cypher.internal.runtime.InternalExecutionResult -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.util.v3_5.ArithmeticException +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.ArithmeticException import scala.util.{Failure, Success, Try} diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/DDminTest.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/DDminTest.scala index a0c1a0b342c10..8d70aa3bab71c 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/DDminTest.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/DDminTest.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.queryReduction -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class DDminTest extends CypherFunSuite with ReductionTestHelper { diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/ReductionTestHelper.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/ReductionTestHelper.scala index 51325e19430fd..0d8b912ad519c 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/ReductionTestHelper.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/ReductionTestHelper.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.queryReduction import org.neo4j.cypher.internal.queryReduction.DDmin.Oracle -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite trait TestExhausted { def assertExhausted(): Unit diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/StatementGTRInput.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/StatementGTRInput.scala index a85467c53eee7..bbcfcc3548730 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/StatementGTRInput.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/StatementGTRInput.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.queryReduction -import org.neo4j.cypher.internal.frontend.v3_5.ast._ +import org.opencypher.v9_0.ast._ import org.neo4j.cypher.internal.queryReduction.ast.ASTNodeHelper._ class StatementGTRInput(initialStatement: Statement) extends GTRInput[Statement](initialStatement) { diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/StatementLevelBTInput.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/StatementLevelBTInput.scala index 6dc25187c0db1..b5eaa2da37177 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/StatementLevelBTInput.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/StatementLevelBTInput.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.queryReduction -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.util.v3_5._ +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.util._ import org.neo4j.cypher.internal.queryReduction.ast.ASTNodeHelper._ import org.neo4j.cypher.internal.queryReduction.ast.copyNodeWith.NodeConverter import org.neo4j.cypher.internal.queryReduction.ast.{copyNodeWith, domainsOf, getChildren} diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/StatementLevelDDInput.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/StatementLevelDDInput.scala index 1d6c084b56a61..8d3766b897e9a 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/StatementLevelDDInput.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/StatementLevelDDInput.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.queryReduction -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.util.v3_5._ +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.util._ import org.neo4j.cypher.internal.queryReduction.ast.ASTNodeHelper._ import org.neo4j.cypher.internal.queryReduction.ast.copyNodeWith import org.neo4j.cypher.internal.queryReduction.ast.copyNodeWith.NodeConverter diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/ast/ASTNodeHelper.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/ast/ASTNodeHelper.scala index 15ee0edfccc66..ec51d8fd07d7f 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/ast/ASTNodeHelper.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/ast/ASTNodeHelper.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.queryReduction.ast -import org.neo4j.cypher.internal.util.v3_5._ +import org.opencypher.v9_0.util._ object ASTNodeHelper { diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/ast/copyNodeWith.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/ast/copyNodeWith.scala index 61be31d0d6921..8af7ab518dc89 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/ast/copyNodeWith.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/ast/copyNodeWith.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.queryReduction.ast -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.util.v3_5._ -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.util._ +import org.opencypher.v9_0.expressions._ object copyNodeWith { diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/ast/domainsOf.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/ast/domainsOf.scala index e34e61a4fcacc..c2a1be0f902aa 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/ast/domainsOf.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/ast/domainsOf.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.queryReduction.ast -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.util.v3_5._ -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.util._ +import org.opencypher.v9_0.expressions._ object domainsOf { diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/ast/getChildren.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/ast/getChildren.scala index 0d969c42476b6..39e19419c16fc 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/ast/getChildren.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/queryReduction/ast/getChildren.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.queryReduction.ast -import org.neo4j.cypher.internal.frontend.v3_5.ast._ -import org.neo4j.cypher.internal.util.v3_5._ -import org.neo4j.cypher.internal.v3_5.expressions.{BinaryOperatorExpression, _} +import org.opencypher.v9_0.ast._ +import org.opencypher.v9_0.util._ +import org.opencypher.v9_0.expressions.{BinaryOperatorExpression, _} object getChildren { diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/CompiledExecutionResultTest.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/CompiledExecutionResultTest.scala index 26c93869c2dd8..8ea82e089b33a 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/CompiledExecutionResultTest.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/CompiledExecutionResultTest.scala @@ -32,8 +32,8 @@ import org.neo4j.cypher.internal.javacompat.ResultRecord import org.neo4j.cypher.internal.runtime.compiled.CompiledExecutionResult import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription import org.neo4j.cypher.internal.runtime.{ExecutionMode, NormalMode, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.TaskCloser -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.TaskCloser +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.result.QueryResult.QueryResultVisitor import org.neo4j.graphdb.NotFoundException import org.neo4j.graphdb.Result.{ResultRow, ResultVisitor} diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/CompiledRuntimeContextHelper.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/CompiledRuntimeContextHelper.scala index dfe49c05de04d..33b170264ffb8 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/CompiledRuntimeContextHelper.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/CompiledRuntimeContextHelper.scala @@ -25,14 +25,14 @@ import org.neo4j.cypher.internal.{PlanFingerprint, PlanFingerprintReference} import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.{Metrics, QueryGraphSolver} import org.neo4j.cypher.internal.compiler.v3_5.{CypherCompilerConfiguration, NotImplementedPlanContext, UpdateStrategy} import org.neo4j.cypher.internal.executionplan.GeneratedQuery -import org.neo4j.cypher.internal.frontend.v3_5.phases.CompilationPhaseTracer.NO_TRACING -import org.neo4j.cypher.internal.frontend.v3_5.phases.{CompilationPhaseTracer, InternalNotificationLogger, Monitors, devNullLogger} +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.NO_TRACING +import org.opencypher.v9_0.frontend.phases.{CompilationPhaseTracer, InternalNotificationLogger, Monitors, devNullLogger} import org.neo4j.cypher.internal.planner.v3_5.spi.PlanContext import org.neo4j.cypher.internal.runtime.compiled.EnterpriseRuntimeContext import org.neo4j.cypher.internal.runtime.compiled.codegen.spi.CodeStructure import org.neo4j.cypher.internal.runtime.vectorized.dispatcher.SingleThreadedExecutor -import org.neo4j.cypher.internal.util.v3_5.attribution.{IdGen, SequentialIdGen} -import org.neo4j.cypher.internal.util.v3_5.{CypherException, InputPosition, InternalException} +import org.opencypher.v9_0.util.attribution.{IdGen, SequentialIdGen} +import org.opencypher.v9_0.util.{CypherException, InputPosition, InternalException} import org.scalatest.mock.MockitoSugar object CompiledRuntimeContextHelper extends MockitoSugar { diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/GeneratedMethodStructureTest.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/GeneratedMethodStructureTest.scala index 67808754ecca7..9c6f69f2a6653 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/GeneratedMethodStructureTest.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/GeneratedMethodStructureTest.scala @@ -26,17 +26,17 @@ import org.neo4j.codegen.source.SourceCode import org.neo4j.codegen.{CodeGenerationStrategy, CodeGenerator, Expression, MethodDeclaration} import org.neo4j.cypher.internal.codegen.QueryExecutionTracer import org.neo4j.cypher.internal.compatibility.v3_5.runtime.executionplan.{Completable, Provider} -import org.neo4j.cypher.internal.frontend.v3_5.helpers._ -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.frontend.helpers._ +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.runtime.compiled.codegen.CodeGenContext import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions.{CodeGenType, CypherCodeGenType, ReferenceType} import org.neo4j.cypher.internal.runtime.compiled.codegen.spi._ import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription import org.neo4j.cypher.internal.runtime.{ExecutionMode, QueryContext} import org.neo4j.cypher.internal.spi.codegen.GeneratedQueryStructure.typeRef -import org.neo4j.cypher.internal.util.v3_5.symbols -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.symbols +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.internal.kernel.api.helpers.RelationshipSelectionCursor import org.neo4j.internal.kernel.api.{CursorFactory, NodeCursor, PropertyCursor, Read, _} import org.neo4j.kernel.impl.core.EmbeddedProxySPI diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/SaveGeneratedSource.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/SaveGeneratedSource.scala index c72a1420f4b40..b0094a3a95feb 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/SaveGeneratedSource.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/SaveGeneratedSource.scala @@ -23,7 +23,7 @@ import java.nio.file.FileVisitResult.CONTINUE import java.nio.file._ import java.nio.file.attribute.BasicFileAttributes import org.neo4j.cypher.internal.spi.codegen.SaveGeneratedSource.GENERATED_SOURCE_LOCATION -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherTestSupport +import org.opencypher.v9_0.util.test_helpers.CypherTestSupport /** * This trait allows debugging generated queries, by generating queries through java source, then making sure that diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/expressions/CodeGenExpressionTypesTest.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/expressions/CodeGenExpressionTypesTest.scala index b8f2aa0a128e3..3b7437600a297 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/expressions/CodeGenExpressionTypesTest.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/expressions/CodeGenExpressionTypesTest.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.compiled_runtime.v3_5.codegen.expressions import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions._ import org.neo4j.cypher.internal.runtime.compiled.codegen.{CodeGenContext, Variable} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class CodeGenExpressionTypesTest extends CypherFunSuite { diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/ir/BuildProbeTableInstructionsTest.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/ir/BuildProbeTableInstructionsTest.scala index b182b516bf205..246e466531736 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/ir/BuildProbeTableInstructionsTest.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/ir/BuildProbeTableInstructionsTest.scala @@ -31,11 +31,11 @@ import org.mockito.stubbing.Answer import org.neo4j.cypher.internal.runtime.compiled.codegen.ir._ import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.expressions.{CodeGenType, NodeProjection} import org.neo4j.cypher.internal.runtime.compiled.codegen.{CodeGenContext, JoinTableMethod, Variable} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.TransactionalContextWrapper -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.Node import org.neo4j.internal.kernel.api._ import org.neo4j.internal.kernel.api.helpers.StubNodeCursor diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/ir/CodeGenSugar.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/ir/CodeGenSugar.scala index 116c241562a4c..f7e59f8787c9a 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/ir/CodeGenSugar.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/ir/CodeGenSugar.scala @@ -29,7 +29,7 @@ import org.neo4j.cypher.internal.runtime.compiled.codegen.ir.Instruction import org.neo4j.cypher.internal.compatibility.v3_5.runtime.executionplan.Provider import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanConstructionTestSupport import org.neo4j.cypher.internal.executionplan.{GeneratedQuery, GeneratedQueryExecution} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.planner.v3_5.spi.{CostBasedPlannerName, GraphStatistics, PlanContext} import org.neo4j.cypher.internal.runtime.compiled.{CompiledExecutionResult, CompiledPlan} import org.neo4j.cypher.internal.runtime.interpreted.TransactionBoundQueryContext.IndexSearchMonitor @@ -37,8 +37,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.{TransactionBoundQueryConte import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription import org.neo4j.cypher.internal.runtime.{ExecutionMode, InternalExecutionResult, NormalMode, QueryContext} import org.neo4j.cypher.internal.spi.codegen.GeneratedQueryStructure -import org.neo4j.cypher.internal.util.v3_5.TaskCloser -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.TaskCloser +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan import org.neo4j.graphdb.GraphDatabaseService import org.neo4j.graphdb.Result.{ResultRow, ResultVisitor} diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/ir/CompiledProfilingTest.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/ir/CompiledProfilingTest.scala index 78d91264da722..a97872cf6a620 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/ir/CompiledProfilingTest.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/spi/codegen/ir/CompiledProfilingTest.scala @@ -33,9 +33,9 @@ import org.neo4j.cypher.internal.runtime.interpreted.TransactionalContextWrapper import org.neo4j.cypher.internal.runtime.planDescription.InternalPlanDescription.Arguments.{DbHits, Rows} import org.neo4j.cypher.internal.runtime.planDescription.{InternalPlanDescription, NoChildren, PlanDescriptionImpl, SingleChild} import org.neo4j.cypher.internal.runtime.{ProfileMode, QueryContext, QueryTransactionalContext} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions.SignedDecimalIntegerLiteral +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions.SignedDecimalIntegerLiteral import org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.v3_5.logical.plans._ import org.neo4j.internal.kernel.api.CursorFactory diff --git a/enterprise/cypher/morsel-runtime/LICENSES.txt b/enterprise/cypher/morsel-runtime/LICENSES.txt index 7e5d556e6a28f..552e3afeedbe7 100644 --- a/enterprise/cypher/morsel-runtime/LICENSES.txt +++ b/enterprise/cypher/morsel-runtime/LICENSES.txt @@ -15,6 +15,12 @@ Apache Software License, Version 2.0 Lucene QueryParsers Netty/All-in-One opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala ------------------------------------------------------------------------------ diff --git a/enterprise/cypher/morsel-runtime/NOTICE.txt b/enterprise/cypher/morsel-runtime/NOTICE.txt index 2056d6133ec35..6d3e80705c977 100644 --- a/enterprise/cypher/morsel-runtime/NOTICE.txt +++ b/enterprise/cypher/morsel-runtime/NOTICE.txt @@ -37,6 +37,12 @@ Apache Software License, Version 2.0 Lucene QueryParsers Netty/All-in-One opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala diff --git a/enterprise/cypher/morsel-runtime/pom.xml b/enterprise/cypher/morsel-runtime/pom.xml index abf2fc67e4138..181c53e7e64d4 100644 --- a/enterprise/cypher/morsel-runtime/pom.xml +++ b/enterprise/cypher/morsel-runtime/pom.xml @@ -101,17 +101,17 @@ - org.neo4j - openCypher-frontend-1 - ${project.version} + org.opencypher + ast-9.0 + ${openCypher.version} test-jar test - org.neo4j - neo4j-cypher-util-3.5 - ${project.version} + org.opencypher + util-9.0 + ${openCypher.version} test-jar test diff --git a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/Message.scala b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/Message.scala index 6b446d3ae7885..df45c4e2bb6fe 100644 --- a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/Message.scala +++ b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/Message.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.vectorized import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.util.InternalException sealed trait Message { def iterationState: Iteration diff --git a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/PipelineBuilder.scala b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/PipelineBuilder.scala index 2decae5155edd..62873142c98be 100644 --- a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/PipelineBuilder.scala +++ b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/PipelineBuilder.scala @@ -22,13 +22,13 @@ package org.neo4j.cypher.internal.runtime.vectorized import org.neo4j.cypher.internal.compatibility.v3_5.runtime.PhysicalPlanningAttributes.SlotConfigurations import org.neo4j.cypher.internal.compatibility.v3_5.runtime.RefSlot import org.neo4j.cypher.internal.compiler.v3_5.planner.CantCompileQueryException -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.runtime.interpreted.commands.convert.ExpressionConverters import org.neo4j.cypher.internal.runtime.interpreted.pipes.{LazyLabel, LazyTypes} import org.neo4j.cypher.internal.runtime.slotted.SlottedPipeBuilder.translateColumnOrder import org.neo4j.cypher.internal.runtime.vectorized.expressions.AggregationExpressionOperator import org.neo4j.cypher.internal.runtime.vectorized.operators._ -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.util.InternalException import org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.v3_5.logical.plans._ diff --git a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/dispatcher/Dispatcher.scala b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/dispatcher/Dispatcher.scala index 4fac0fe9ef6c3..6442ae18e0c6f 100644 --- a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/dispatcher/Dispatcher.scala +++ b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/dispatcher/Dispatcher.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.vectorized.dispatcher import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.vectorized.Pipeline -import org.neo4j.cypher.internal.util.v3_5.TaskCloser +import org.opencypher.v9_0.util.TaskCloser import org.neo4j.cypher.result.QueryResult.QueryResultVisitor import org.neo4j.values.virtual.MapValue diff --git a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/dispatcher/ParallelDispatcher.scala b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/dispatcher/ParallelDispatcher.scala index 10d3b47872562..43f0f950a91a0 100644 --- a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/dispatcher/ParallelDispatcher.scala +++ b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/dispatcher/ParallelDispatcher.scala @@ -25,7 +25,7 @@ import java.util.{concurrent, function} import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.vectorized._ -import org.neo4j.cypher.internal.util.v3_5.{InternalException, TaskCloser} +import org.opencypher.v9_0.util.{InternalException, TaskCloser} import org.neo4j.cypher.result.QueryResult.QueryResultVisitor import org.neo4j.util.concurrent.BinaryLatch import org.neo4j.values.virtual.MapValue diff --git a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/dispatcher/SingleThreadedExecutor.scala b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/dispatcher/SingleThreadedExecutor.scala index cff87d7cacbcf..a65670c343a71 100644 --- a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/dispatcher/SingleThreadedExecutor.scala +++ b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/dispatcher/SingleThreadedExecutor.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.vectorized.dispatcher import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.vectorized._ -import org.neo4j.cypher.internal.util.v3_5.{InternalException, TaskCloser} +import org.opencypher.v9_0.util.{InternalException, TaskCloser} import org.neo4j.cypher.result.QueryResult.QueryResultVisitor import org.neo4j.values.virtual.MapValue diff --git a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/AggregationExpressionOperator.scala b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/AggregationExpressionOperator.scala index 31e955bf6083d..0d4ede4586230 100644 --- a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/AggregationExpressionOperator.scala +++ b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/AggregationExpressionOperator.scala @@ -23,8 +23,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.pipes.{QueryState => OldQueryState} import org.neo4j.cypher.internal.runtime.vectorized.MorselExecutionContext -import org.neo4j.cypher.internal.util.v3_5.SyntaxException -import org.neo4j.cypher.internal.util.v3_5.symbols.CypherType +import org.opencypher.v9_0.util.SyntaxException +import org.opencypher.v9_0.util.symbols.CypherType import org.neo4j.values.AnyValue abstract class AggregationExpressionOperator extends Expression { diff --git a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/AvgOperatorExpression.scala b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/AvgOperatorExpression.scala index 895beb4c61ce4..cf9f0cd5cfc92 100644 --- a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/AvgOperatorExpression.scala +++ b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/AvgOperatorExpression.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.vectorized.expressions import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.pipes.{QueryState => OldQueryState} import org.neo4j.cypher.internal.runtime.vectorized._ -import org.neo4j.cypher.internal.util.v3_5.symbols.CTAny +import org.opencypher.v9_0.util.symbols.CTAny import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values.longValue import org.neo4j.values.storable.{LongValue, NumberValue, Values} diff --git a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/CollectOperatorExpression.scala b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/CollectOperatorExpression.scala index fdd73e1443a95..04dac1cd8f0aa 100644 --- a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/CollectOperatorExpression.scala +++ b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/CollectOperatorExpression.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.vectorized.expressions import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.pipes.{QueryState => OldQueryState} import org.neo4j.cypher.internal.runtime.vectorized._ -import org.neo4j.cypher.internal.util.v3_5.symbols.CTAny +import org.opencypher.v9_0.util.symbols.CTAny import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values import org.neo4j.values.virtual.{ListValue, VirtualValues} diff --git a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/CountOperatorExpression.scala b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/CountOperatorExpression.scala index 83b696459bb0e..7a796c1d04d7d 100644 --- a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/CountOperatorExpression.scala +++ b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/CountOperatorExpression.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.vectorized.expressions import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.pipes.{QueryState => OldQueryState} import org.neo4j.cypher.internal.runtime.vectorized._ -import org.neo4j.cypher.internal.util.v3_5.symbols.CTAny +import org.opencypher.v9_0.util.symbols.CTAny import org.neo4j.values.AnyValue import org.neo4j.values.storable.{NumberValue, Values} diff --git a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/MinOrMaxOperatorExpression.scala b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/MinOrMaxOperatorExpression.scala index 87f496d8d13a9..e9a60e1c57236 100644 --- a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/MinOrMaxOperatorExpression.scala +++ b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/MinOrMaxOperatorExpression.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.vectorized.expressions import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.pipes.{QueryState => OldQueryState} import org.neo4j.cypher.internal.runtime.vectorized.MorselExecutionContext -import org.neo4j.cypher.internal.util.v3_5.symbols.CTAny +import org.opencypher.v9_0.util.symbols.CTAny import org.neo4j.values.storable.Values import org.neo4j.values.{AnyValue, AnyValues} diff --git a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/MorselExpressionConverters.scala b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/MorselExpressionConverters.scala index cb6b112c1148a..1c6c8fd68dc54 100644 --- a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/MorselExpressionConverters.scala +++ b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/MorselExpressionConverters.scala @@ -22,11 +22,10 @@ package org.neo4j.cypher.internal.runtime.vectorized.expressions import org.neo4j.cypher.internal.compiler.v3_5.planner.CantCompileQueryException import org.neo4j.cypher.internal.runtime.interpreted.commands.convert.{ExpressionConverter, ExpressionConverters} import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression -import org.neo4j.cypher.internal.runtime.interpreted.pipes.{QueryState => OldQueryState} -import org.neo4j.cypher.internal.v3_5.expressions._ -import org.neo4j.cypher.internal.v3_5.functions.AggregatingFunction -import org.neo4j.cypher.internal.v3_5.{functions, expressions => ast} - +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.expressions.functions.AggregatingFunction +import org.opencypher.v9_0.{expressions => ast} +import org.opencypher.v9_0.expressions.functions object MorselExpressionConverters extends ExpressionConverter { diff --git a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/ArgumentOperator.scala b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/ArgumentOperator.scala index 4bc808287b89f..6590de4add86e 100644 --- a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/ArgumentOperator.scala +++ b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/ArgumentOperator.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.vectorized.operators import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.vectorized._ -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.util.InternalException class ArgumentOperator extends Operator { override def operate(message: Message, data: Morsel, context: QueryContext, state: QueryState): Continuation = { diff --git a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/ExpandAllOperator.scala b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/ExpandAllOperator.scala index 666b19ee76dd2..223bb8f834bae 100644 --- a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/ExpandAllOperator.scala +++ b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/ExpandAllOperator.scala @@ -24,8 +24,8 @@ import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.LazyTypes import org.neo4j.cypher.internal.runtime.slotted.helpers.NullChecker.entityIsNull import org.neo4j.cypher.internal.runtime.vectorized._ -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.internal.kernel.api.helpers.RelationshipSelectionCursor class ExpandAllOperator(toSlots: SlotConfiguration, diff --git a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/NodeIndexSeekOperator.scala b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/NodeIndexSeekOperator.scala index 50823033fd41f..be4f69a1dcd31 100644 --- a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/NodeIndexSeekOperator.scala +++ b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/NodeIndexSeekOperator.scala @@ -23,7 +23,7 @@ import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.pipes.{QueryState => OldQueryState} import org.neo4j.cypher.internal.runtime.vectorized._ -import org.neo4j.cypher.internal.v3_5.expressions.{LabelToken, PropertyKeyToken} +import org.opencypher.v9_0.expressions.{LabelToken, PropertyKeyToken} import org.neo4j.internal.kernel.api._ class NodeIndexSeekOperator(longsPerRow: Int, refsPerRow: Int, offset: Int, diff --git a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/ProduceResultOperator.scala b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/ProduceResultOperator.scala index afb3d7485bef3..63a2ed8bb1674 100644 --- a/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/ProduceResultOperator.scala +++ b/enterprise/cypher/morsel-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/ProduceResultOperator.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.vectorized.operators import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{LongSlot, RefSlot, SlotConfiguration} import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.vectorized._ -import org.neo4j.cypher.internal.util.v3_5.symbols +import org.opencypher.v9_0.util.symbols import org.neo4j.cypher.result.QueryResult import org.neo4j.values.AnyValue diff --git a/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/AvgOperatorExpressionTest.scala b/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/AvgOperatorExpressionTest.scala index 72aba4156acbf..c5638ea36683d 100644 --- a/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/AvgOperatorExpressionTest.scala +++ b/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/expressions/AvgOperatorExpressionTest.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.vectorized.expressions import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState import org.neo4j.cypher.internal.runtime.vectorized.MorselExecutionContext import org.neo4j.cypher.internal.runtime.vectorized.operators.DummyExpression -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values import org.neo4j.values.storable.Values.longValue import org.neo4j.values.virtual.VirtualValues.list diff --git a/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/AggregationMapperOperatorNoGroupingTest.scala b/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/AggregationMapperOperatorNoGroupingTest.scala index 960785d7c717d..b9f563425e1a6 100644 --- a/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/AggregationMapperOperatorNoGroupingTest.scala +++ b/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/AggregationMapperOperatorNoGroupingTest.scala @@ -22,8 +22,8 @@ package org.neo4j.cypher.internal.runtime.vectorized.operators import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{LongSlot, RefSlot, SlotConfiguration} import org.neo4j.cypher.internal.runtime.interpreted.pipes.{QueryState => OldQueryState} import org.neo4j.cypher.internal.runtime.vectorized.{Iteration, Morsel, QueryState} -import org.neo4j.cypher.internal.util.v3_5.symbols.{CTAny, CTNode} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols.{CTAny, CTNode} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values import org.neo4j.values.virtual.VirtualValues diff --git a/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/AggregationMapperOperatorTest.scala b/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/AggregationMapperOperatorTest.scala index a47dcf73f9bc8..d19b68fa01757 100644 --- a/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/AggregationMapperOperatorTest.scala +++ b/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/AggregationMapperOperatorTest.scala @@ -22,8 +22,8 @@ package org.neo4j.cypher.internal.runtime.vectorized.operators import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{LongSlot, RefSlot, SlotConfiguration} import org.neo4j.cypher.internal.runtime.interpreted.pipes.{QueryState => OldQueryState} import org.neo4j.cypher.internal.runtime.vectorized.{Iteration, Morsel, QueryState} -import org.neo4j.cypher.internal.util.v3_5.symbols.{CTAny, CTNode} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols.{CTAny, CTNode} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values import org.neo4j.values.storable.Values.stringValue diff --git a/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/AggregationReducerOperatorNoGroupingTest.scala b/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/AggregationReducerOperatorNoGroupingTest.scala index 665f1f0af384c..b4bebdde82257 100644 --- a/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/AggregationReducerOperatorNoGroupingTest.scala +++ b/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/AggregationReducerOperatorNoGroupingTest.scala @@ -22,8 +22,8 @@ package org.neo4j.cypher.internal.runtime.vectorized.operators import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{RefSlot, SlotConfiguration} import org.neo4j.cypher.internal.runtime.interpreted.pipes.{QueryState => OldQueryState} import org.neo4j.cypher.internal.runtime.vectorized.{Iteration, Morsel, QueryState, StartLoopWithEagerData} -import org.neo4j.cypher.internal.util.v3_5.symbols.CTAny -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols.CTAny +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values import org.neo4j.values.virtual.VirtualValues diff --git a/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/AggregationReducerOperatorTest.scala b/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/AggregationReducerOperatorTest.scala index add9dc283c32b..d36294b5db7bf 100644 --- a/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/AggregationReducerOperatorTest.scala +++ b/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/AggregationReducerOperatorTest.scala @@ -22,8 +22,8 @@ package org.neo4j.cypher.internal.runtime.vectorized.operators import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{LongSlot, RefSlot, SlotConfiguration} import org.neo4j.cypher.internal.runtime.interpreted.pipes.{QueryState => OldQueryState} import org.neo4j.cypher.internal.runtime.vectorized.{Iteration, Morsel, QueryState, StartLoopWithEagerData} -import org.neo4j.cypher.internal.util.v3_5.symbols.{CTAny, CTNode} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols.{CTAny, CTNode} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values import org.neo4j.values.storable.Values.stringValue diff --git a/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/MergeSortOperatorTest.scala b/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/MergeSortOperatorTest.scala index b921ca658b762..b07a3da7b63a7 100644 --- a/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/MergeSortOperatorTest.scala +++ b/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/MergeSortOperatorTest.scala @@ -22,8 +22,8 @@ package org.neo4j.cypher.internal.runtime.vectorized.operators import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{LongSlot, SlotConfiguration} import org.neo4j.cypher.internal.runtime.slotted.pipes.Ascending import org.neo4j.cypher.internal.runtime.vectorized._ -import org.neo4j.cypher.internal.util.v3_5.symbols.CTNode -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols.CTNode +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.AnyValue import scala.collection.mutable diff --git a/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/PreSortOperatorTest.scala b/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/PreSortOperatorTest.scala index 23fcede78f636..41cd6b3480320 100644 --- a/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/PreSortOperatorTest.scala +++ b/enterprise/cypher/morsel-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/vectorized/operators/PreSortOperatorTest.scala @@ -22,8 +22,8 @@ package org.neo4j.cypher.internal.runtime.vectorized.operators import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{LongSlot, RefSlot, SlotConfiguration} import org.neo4j.cypher.internal.runtime.slotted.pipes.Ascending import org.neo4j.cypher.internal.runtime.vectorized.{Iteration, Morsel} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values.intValue diff --git a/enterprise/cypher/physical-planning/LICENSES.txt b/enterprise/cypher/physical-planning/LICENSES.txt index a4f37f6f470de..cf8966b8a700c 100644 --- a/enterprise/cypher/physical-planning/LICENSES.txt +++ b/enterprise/cypher/physical-planning/LICENSES.txt @@ -15,6 +15,12 @@ Apache Software License, Version 2.0 Lucene QueryParsers Netty/All-in-One opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala ------------------------------------------------------------------------------ diff --git a/enterprise/cypher/physical-planning/NOTICE.txt b/enterprise/cypher/physical-planning/NOTICE.txt index cd815ae673f36..947c545b692ad 100644 --- a/enterprise/cypher/physical-planning/NOTICE.txt +++ b/enterprise/cypher/physical-planning/NOTICE.txt @@ -37,6 +37,12 @@ Apache Software License, Version 2.0 Lucene QueryParsers Netty/All-in-One opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala diff --git a/enterprise/cypher/physical-planning/pom.xml b/enterprise/cypher/physical-planning/pom.xml index e4dff261adbb8..6b428ff7264d2 100644 --- a/enterprise/cypher/physical-planning/pom.xml +++ b/enterprise/cypher/physical-planning/pom.xml @@ -146,17 +146,17 @@ - org.neo4j - openCypher-frontend-1 - ${project.version} + org.opencypher + util-9.0 + ${openCypher.version} test-jar test - org.neo4j - neo4j-cypher-util-3.5 - ${project.version} + org.opencypher + ast-9.0 + ${openCypher.version} test-jar test diff --git a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/PhysicalPlanningAttributes.scala b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/PhysicalPlanningAttributes.scala index e42b1c3d195b9..a9fc912da930a 100644 --- a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/PhysicalPlanningAttributes.scala +++ b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/PhysicalPlanningAttributes.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.compatibility.v3_5.runtime import org.neo4j.cypher.internal.compatibility.v3_5.runtime.SlotConfiguration.Size -import org.neo4j.cypher.internal.util.v3_5.attribution.Attribute +import org.opencypher.v9_0.util.attribution.Attribute object PhysicalPlanningAttributes { class SlotConfigurations extends Attribute[SlotConfiguration] diff --git a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/Slot.scala b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/Slot.scala index 1239c0b701b63..17c068915bfba 100644 --- a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/Slot.scala +++ b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/Slot.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5.runtime -import org.neo4j.cypher.internal.util.v3_5.symbols.CypherType +import org.opencypher.v9_0.util.symbols.CypherType sealed trait Slot { def offset: Int diff --git a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/SlotAllocation.scala b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/SlotAllocation.scala index 191e67f1498c3..26f85491e778c 100644 --- a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/SlotAllocation.scala +++ b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/SlotAllocation.scala @@ -21,15 +21,15 @@ package org.neo4j.cypher.internal.compatibility.v3_5.runtime import org.neo4j.cypher.internal.compatibility.v3_5.runtime.PhysicalPlanningAttributes.{ArgumentSizes, SlotConfigurations} import org.neo4j.cypher.internal.compatibility.v3_5.runtime.SlotConfiguration.Size -import org.neo4j.cypher.internal.frontend.v3_5.ast.ProcedureResultItem -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.ProcedureResultItem +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5.{HasHeaders, NoHeaders, ShortestPathPattern} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.{Foldable, InternalException, UnNamedNameGenerator} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.{Foldable, InternalException, UnNamedNameGenerator} +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans._ -import org.neo4j.cypher.internal.v3_5.{expressions => parserAst} +import org.opencypher.v9_0.{expressions => parserAst} import scala.collection.mutable diff --git a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/SlotConfiguration.scala b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/SlotConfiguration.scala index b6c9d696ae687..23099d5aa6421 100644 --- a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/SlotConfiguration.scala +++ b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/SlotConfiguration.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5.runtime -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.util.v3_5.symbols.CypherType +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.util.symbols.CypherType import org.neo4j.cypher.internal.v3_5.logical.plans.LogicalPlan import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.values.AnyValue diff --git a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/SlottedRewriter.scala b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/SlottedRewriter.scala index 30dff587650a0..26639ad9e6816 100644 --- a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/SlottedRewriter.scala +++ b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/SlottedRewriter.scala @@ -23,14 +23,14 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.PhysicalPlanningAttr import org.neo4j.cypher.internal.compatibility.v3_5.runtime.ast._ import org.neo4j.cypher.internal.compiler.v3_5.planner.CantCompileQueryException import org.neo4j.cypher.internal.planner.v3_5.spi.TokenContext -import org.neo4j.cypher.internal.util.v3_5.AssertionUtils.ifAssertionsEnabled -import org.neo4j.cypher.internal.util.v3_5.Foldable._ -import org.neo4j.cypher.internal.util.v3_5.attribution.SameId -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.{InternalException, Rewriter, topDown} -import org.neo4j.cypher.internal.v3_5.expressions.{FunctionInvocation, _} import org.neo4j.cypher.internal.v3_5.logical.plans.{LogicalPlan, NestedPlanExpression, Projection, VarExpand, _} -import org.neo4j.cypher.internal.v3_5.{expressions, functions => frontendFunctions} +import org.opencypher.v9_0.expressions +import org.opencypher.v9_0.expressions.{FunctionInvocation, functions => frontendFunctions, _} +import org.opencypher.v9_0.util.AssertionUtils.ifAssertionsEnabled +import org.opencypher.v9_0.util.Foldable._ +import org.opencypher.v9_0.util.attribution.SameId +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.{InternalException, Rewriter, topDown} /** * This class rewrites logical plans so they use slotted variable access instead of using key-based. It will also diff --git a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/GetDegreePrimitive.scala b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/GetDegreePrimitive.scala index 3b6a8c108a00a..63a410bc2bd2a 100644 --- a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/GetDegreePrimitive.scala +++ b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/GetDegreePrimitive.scala @@ -19,6 +19,6 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5.runtime.ast -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection case class GetDegreePrimitive(offset: Int, typ: Option[String], direction: SemanticDirection) extends RuntimeExpression diff --git a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/NodeProperty.scala b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/NodeProperty.scala index fdd5c2f9b4e95..d5e3788061d10 100644 --- a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/NodeProperty.scala +++ b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/NodeProperty.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5.runtime.ast -import org.neo4j.cypher.internal.v3_5.expressions.Property +import org.opencypher.v9_0.expressions.Property case class NodeProperty(offset: Int, propToken: Int, name: String)(prop: Property) extends RuntimeProperty(prop) { override def asCanonicalStringVal: String = name diff --git a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/NullCheck.scala b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/NullCheck.scala index 903dafadab426..4274b6a5c8042 100644 --- a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/NullCheck.scala +++ b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/NullCheck.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5.runtime.ast -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, LogicalProperty, LogicalVariable} +import org.opencypher.v9_0.expressions.{Expression, LogicalProperty, LogicalVariable} case class NullCheck(offset: Int, inner: Expression) extends RuntimeExpression diff --git a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/PrimitiveEquals.scala b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/PrimitiveEquals.scala index 1ad60c5844f63..32b825866b243 100644 --- a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/PrimitiveEquals.scala +++ b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/PrimitiveEquals.scala @@ -19,6 +19,6 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5.runtime.ast -import org.neo4j.cypher.internal.v3_5.expressions.Expression +import org.opencypher.v9_0.expressions.Expression case class PrimitiveEquals(a: Expression, b: Expression) extends RuntimeExpression diff --git a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/RelationshipProperty.scala b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/RelationshipProperty.scala index 1ecfd4f7579bb..e6bd31c31d593 100644 --- a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/RelationshipProperty.scala +++ b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/RelationshipProperty.scala @@ -19,7 +19,7 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5.runtime.ast -import org.neo4j.cypher.internal.v3_5.expressions.LogicalProperty +import org.opencypher.v9_0.expressions.LogicalProperty case class RelationshipProperty(offset: Int, propToken: Int, name: String)(prop: LogicalProperty) extends RuntimeProperty(prop) { override def asCanonicalStringVal: String = name diff --git a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/RuntimeExpression.scala b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/RuntimeExpression.scala index 90877be0ceef2..c898c82f26061 100644 --- a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/RuntimeExpression.scala +++ b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/RuntimeExpression.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5.runtime.ast -import org.neo4j.cypher.internal.util.v3_5.InputPosition -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticCheckResult, SemanticCheckableExpression} -import org.neo4j.cypher.internal.frontend.v3_5.SemanticCheck -import org.neo4j.cypher.internal.v3_5.expressions.{Expression => ASTExpression} +import org.opencypher.v9_0.util.InputPosition +import org.opencypher.v9_0.ast.semantics.{SemanticCheckResult, SemanticCheckableExpression} +import org.opencypher.v9_0.ast.semantics.SemanticCheck +import org.opencypher.v9_0.expressions.{Expression => ASTExpression} trait RuntimeExpression extends ASTExpression with SemanticCheckableExpression { override def semanticCheck(ctx: ASTExpression.SemanticContext): SemanticCheck = SemanticCheckResult.success diff --git a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/RuntimeProperty.scala b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/RuntimeProperty.scala index 9b6dabcbce4d2..18ec120ec6f85 100644 --- a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/RuntimeProperty.scala +++ b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/RuntimeProperty.scala @@ -19,11 +19,11 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5.runtime.ast -import org.neo4j.cypher.internal.frontend.v3_5.SemanticCheck -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticCheckResult, SemanticCheckableExpression} -import org.neo4j.cypher.internal.util.v3_5.AssertionUtils.ifAssertionsEnabled -import org.neo4j.cypher.internal.util.v3_5.{InputPosition, InternalException, Rewritable} -import org.neo4j.cypher.internal.v3_5.expressions.{Expression, LogicalProperty, PropertyKeyName} +import org.opencypher.v9_0.ast.semantics.SemanticCheck +import org.opencypher.v9_0.ast.semantics.{SemanticCheckResult, SemanticCheckableExpression} +import org.opencypher.v9_0.util.AssertionUtils.ifAssertionsEnabled +import org.opencypher.v9_0.util.{InputPosition, InternalException, Rewritable} +import org.opencypher.v9_0.expressions.{Expression, LogicalProperty, PropertyKeyName} abstract class RuntimeProperty(val prop: LogicalProperty) extends LogicalProperty with SemanticCheckableExpression{ override def semanticCheck(ctx: Expression.SemanticContext): SemanticCheck = SemanticCheckResult.success diff --git a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/RuntimeVariable.scala b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/RuntimeVariable.scala index 37845bfe4adac..bbd4d4ee8ae12 100644 --- a/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/RuntimeVariable.scala +++ b/enterprise/cypher/physical-planning/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/ast/RuntimeVariable.scala @@ -19,10 +19,10 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5.runtime.ast -import org.neo4j.cypher.internal.frontend.v3_5.SemanticCheck -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{SemanticCheckResult, SemanticCheckableExpression} -import org.neo4j.cypher.internal.util.v3_5.{InputPosition, InternalException} -import org.neo4j.cypher.internal.v3_5.expressions.{LogicalVariable, Expression => ASTExpression} +import org.opencypher.v9_0.ast.semantics.SemanticCheck +import org.opencypher.v9_0.ast.semantics.{SemanticCheckResult, SemanticCheckableExpression} +import org.opencypher.v9_0.util.{InputPosition, InternalException} +import org.opencypher.v9_0.expressions.{LogicalVariable, Expression => ASTExpression} abstract class RuntimeVariable(override val name: String) extends LogicalVariable with SemanticCheckableExpression { override def semanticCheck(ctx: ASTExpression.SemanticContext): SemanticCheck = SemanticCheckResult.success diff --git a/enterprise/cypher/physical-planning/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_4/runtime/SlotAllocationArgumentsTest.scala b/enterprise/cypher/physical-planning/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_4/runtime/SlotAllocationArgumentsTest.scala index 1d329ec45fb49..f8d35b6a99ba0 100644 --- a/enterprise/cypher/physical-planning/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_4/runtime/SlotAllocationArgumentsTest.scala +++ b/enterprise/cypher/physical-planning/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_4/runtime/SlotAllocationArgumentsTest.scala @@ -21,9 +21,9 @@ package org.neo4j.cypher.internal.compatibility.v3_5.runtime import org.neo4j.cypher.internal.compatibility.v3_5.runtime.SlotConfiguration.Size import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.ast.semantics.SemanticTable +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans._ class SlotAllocationArgumentsTest extends CypherFunSuite with LogicalPlanningTestSupport2 { diff --git a/enterprise/cypher/physical-planning/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_4/runtime/SlotAllocationTest.scala b/enterprise/cypher/physical-planning/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_4/runtime/SlotAllocationTest.scala index beb8f6903902d..45bd8615f27bf 100644 --- a/enterprise/cypher/physical-planning/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_4/runtime/SlotAllocationTest.scala +++ b/enterprise/cypher/physical-planning/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_4/runtime/SlotAllocationTest.scala @@ -20,13 +20,13 @@ package org.neo4j.cypher.internal.compatibility.v3_5.runtime import org.neo4j.cypher.internal.compiler.v3_5.planner.LogicalPlanningTestSupport2 -import org.neo4j.cypher.internal.frontend.v3_5.ast.ASTAnnotationMap -import org.neo4j.cypher.internal.frontend.v3_5.semantics.{ExpressionTypeInfo, SemanticTable} +import org.opencypher.v9_0.ast.ASTAnnotationMap +import org.opencypher.v9_0.ast.semantics.{ExpressionTypeInfo, SemanticTable} import org.neo4j.cypher.internal.ir.v3_5.{PlannerQuery, VarPatternLength} -import org.neo4j.cypher.internal.util.v3_5.LabelId -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.LabelId +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans.{Ascending, _} import org.neo4j.cypher.internal.v3_5.logical.{plans => logicalPlans} diff --git a/enterprise/cypher/physical-planning/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_4/runtime/SlotConfigurationTest.scala b/enterprise/cypher/physical-planning/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_4/runtime/SlotConfigurationTest.scala index 1a763aa610703..74d790688bb78 100644 --- a/enterprise/cypher/physical-planning/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_4/runtime/SlotConfigurationTest.scala +++ b/enterprise/cypher/physical-planning/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_4/runtime/SlotConfigurationTest.scala @@ -19,9 +19,9 @@ */ package org.neo4j.cypher.internal.compatibility.v3_5.runtime -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class SlotConfigurationTest extends CypherFunSuite { test("allocating same variable name with compatible type but different nullability should increase nullability 1") { diff --git a/enterprise/cypher/physical-planning/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_4/runtime/SlottedRewriterTest.scala b/enterprise/cypher/physical-planning/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_4/runtime/SlottedRewriterTest.scala index d8a472fa52205..98403c99ae43f 100644 --- a/enterprise/cypher/physical-planning/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_4/runtime/SlottedRewriterTest.scala +++ b/enterprise/cypher/physical-planning/src/test/scala/org/neo4j/cypher/internal/compatibility/v3_4/runtime/SlottedRewriterTest.scala @@ -22,14 +22,14 @@ package org.neo4j.cypher.internal.compatibility.v3_5.runtime import org.mockito.Mockito._ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.PhysicalPlanningAttributes.SlotConfigurations import org.neo4j.cypher.internal.compatibility.v3_5.runtime.ast._ -import org.neo4j.cypher.internal.frontend.v3_5.ast._ +import org.opencypher.v9_0.ast._ import org.neo4j.cypher.internal.ir.v3_5.PlannerQuery import org.neo4j.cypher.internal.planner.v3_5.spi.TokenContext -import org.neo4j.cypher.internal.util.v3_5.attribution.{Id, SequentialIdGen} -import org.neo4j.cypher.internal.util.v3_5.NonEmptyList -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.attribution.{Id, SequentialIdGen} +import org.opencypher.v9_0.util.NonEmptyList +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans.{AllNodesScan, ProduceResult, Selection, _} class SlottedRewriterTest extends CypherFunSuite with AstConstructionTestSupport { diff --git a/enterprise/cypher/pom.xml b/enterprise/cypher/pom.xml index 7d442e7864f1b..a57f980cac217 100644 --- a/enterprise/cypher/pom.xml +++ b/enterprise/cypher/pom.xml @@ -21,6 +21,7 @@ notice-agpl-prefix.txt AGPL-3-header.txt 1.0.0-M09 + 1.0.0 diff --git a/enterprise/cypher/slotted-runtime/LICENSES.txt b/enterprise/cypher/slotted-runtime/LICENSES.txt index a4f37f6f470de..cf8966b8a700c 100644 --- a/enterprise/cypher/slotted-runtime/LICENSES.txt +++ b/enterprise/cypher/slotted-runtime/LICENSES.txt @@ -15,6 +15,12 @@ Apache Software License, Version 2.0 Lucene QueryParsers Netty/All-in-One opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala ------------------------------------------------------------------------------ diff --git a/enterprise/cypher/slotted-runtime/NOTICE.txt b/enterprise/cypher/slotted-runtime/NOTICE.txt index cd815ae673f36..947c545b692ad 100644 --- a/enterprise/cypher/slotted-runtime/NOTICE.txt +++ b/enterprise/cypher/slotted-runtime/NOTICE.txt @@ -37,6 +37,12 @@ Apache Software License, Version 2.0 Lucene QueryParsers Netty/All-in-One opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala diff --git a/enterprise/cypher/slotted-runtime/pom.xml b/enterprise/cypher/slotted-runtime/pom.xml index 512ce8f2e1b7e..40f9a9f10598d 100644 --- a/enterprise/cypher/slotted-runtime/pom.xml +++ b/enterprise/cypher/slotted-runtime/pom.xml @@ -161,17 +161,17 @@ - org.neo4j - openCypher-frontend-1 - ${project.version} + org.opencypher + ast-9.0 + ${openCypher.version} test-jar test - org.neo4j - neo4j-cypher-util-3.5 - ${project.version} + org.opencypher + util-9.0 + ${openCypher.version} test-jar test diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/ArrayResultExecutionContext.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/ArrayResultExecutionContext.scala index 9f68f056f588f..00d6896581682 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/ArrayResultExecutionContext.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/ArrayResultExecutionContext.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.slotted import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState -import org.neo4j.cypher.internal.util.v3_5.InternalException +import org.opencypher.v9_0.util.InternalException import org.neo4j.cypher.result.QueryResult import org.neo4j.values.AnyValue diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/SlottedExecutionContext.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/SlottedExecutionContext.scala index 226a0429b9e8d..b09d314b094f5 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/SlottedExecutionContext.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/SlottedExecutionContext.scala @@ -22,9 +22,9 @@ package org.neo4j.cypher.internal.runtime.slotted import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{LongSlot, RefSlot, SlotConfiguration} import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.slotted.helpers.NullChecker.entityIsNull -import org.neo4j.cypher.internal.util.v3_5.AssertionUtils._ -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.util.v3_5.symbols.{CTNode, CTRelationship} +import org.opencypher.v9_0.util.AssertionUtils._ +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.util.symbols.{CTNode, CTRelationship} import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values import org.neo4j.values.virtual._ diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/SlottedPipeBuilder.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/SlottedPipeBuilder.scala index 1f3fd91b35d89..a25f1ff064beb 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/SlottedPipeBuilder.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/SlottedPipeBuilder.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.slotted import org.neo4j.cypher.internal.compatibility.v3_5.runtime.SlotAllocation.PhysicalPlan import org.neo4j.cypher.internal.compatibility.v3_5.runtime._ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.ast.{NodeFromSlot, RelationshipFromSlot} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5.VarPatternLength import org.neo4j.cypher.internal.planner.v3_5.spi.TokenContext import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, InterpretedPipeBuilder} @@ -34,14 +34,14 @@ import org.neo4j.cypher.internal.runtime.interpreted.pipes.{DropResultPipe, Colu import org.neo4j.cypher.internal.runtime.slotted.helpers.SlottedPipeBuilderUtils import org.neo4j.cypher.internal.runtime.slotted.pipes._ import org.neo4j.cypher.internal.runtime.slotted.{expressions => slottedExpressions} -import org.neo4j.cypher.internal.util.v3_5.AssertionUtils._ -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.v3_5.expressions.{Equals, SignedDecimalIntegerLiteral} +import org.opencypher.v9_0.util.AssertionUtils._ +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.expressions.{Equals, SignedDecimalIntegerLiteral} import org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.v3_5.logical.plans._ -import org.neo4j.cypher.internal.v3_5.{expressions => frontEndAst} +import org.opencypher.v9_0.{expressions => frontEndAst} class SlottedPipeBuilder(fallback: PipeBuilder, expressionConverters: ExpressionConverters, diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/expressions/GetDegreePrimitive.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/expressions/GetDegreePrimitive.scala index d5500169dacd7..07fedf9dfa001 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/expressions/GetDegreePrimitive.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/expressions/GetDegreePrimitive.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.slotted.expressions import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/expressions/SlottedExpressionConverters.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/expressions/SlottedExpressionConverters.scala index 92ba6d1dd0ceb..0670e555b8344 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/expressions/SlottedExpressionConverters.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/expressions/SlottedExpressionConverters.scala @@ -24,8 +24,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.convert.{Expressio import org.neo4j.cypher.internal.runtime.interpreted.commands.{expressions => commands} import org.neo4j.cypher.internal.runtime.slotted.{expressions => runtimeExpression} import org.neo4j.cypher.internal.runtime.slotted.expressions.SlottedProjectedPath._ -import org.neo4j.cypher.internal.v3_5.expressions._ -import org.neo4j.cypher.internal.v3_5.{expressions => ast} +import org.opencypher.v9_0.expressions._ +import org.opencypher.v9_0.{expressions => ast} object SlottedExpressionConverters extends ExpressionConverter { override def toCommandExpression(expression: ast.Expression, self: ExpressionConverters): Option[commands.Expression] = diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/helpers/SlottedPipeBuilderUtils.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/helpers/SlottedPipeBuilderUtils.scala index 47c6906a34883..55e5e9f918e84 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/helpers/SlottedPipeBuilderUtils.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/helpers/SlottedPipeBuilderUtils.scala @@ -22,8 +22,8 @@ package org.neo4j.cypher.internal.runtime.slotted.helpers import NullChecker.entityIsNull import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{LongSlot, RefSlot, Slot} import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext -import org.neo4j.cypher.internal.util.v3_5.{AssertionUtils, InternalException, ParameterWrongTypeException} -import org.neo4j.cypher.internal.util.v3_5.symbols.{CTNode, CTRelationship, CypherType} +import org.opencypher.v9_0.util.{AssertionUtils, InternalException, ParameterWrongTypeException} +import org.opencypher.v9_0.util.symbols.{CTNode, CTRelationship, CypherType} import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values import org.neo4j.values.virtual.{VirtualNodeValue, VirtualRelationshipValue, VirtualValues} diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/AllNodesScanSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/AllNodesScanSlottedPipe.scala index ee44c3b81ccd5..c16a3ce6ce456 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/AllNodesScanSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/AllNodesScanSlottedPipe.scala @@ -25,7 +25,7 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.helpers.PrimitiveLon import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, QueryState} import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class AllNodesScanSlottedPipe(ident: String, slots: SlotConfiguration, argumentSize: Size) (val id: Id = Id.INVALID_ID) extends Pipe { diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ApplySlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ApplySlottedPipe.scala index 948e50623e254..885b23dec921d 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ApplySlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ApplySlottedPipe.scala @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.runtime.slotted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, PipeWithSource, QueryState} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class ApplySlottedPipe(lhs: Pipe, rhs: Pipe) (val id: Id = Id.INVALID_ID) diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ArgumentSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ArgumentSlottedPipe.scala index 958ec31882f0e..d8bfd173e0085 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ArgumentSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ArgumentSlottedPipe.scala @@ -23,7 +23,7 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.SlotConfiguration import org.neo4j.cypher.internal.compatibility.v3_5.runtime.SlotConfiguration.Size import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, QueryState} import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class ArgumentSlottedPipe(slots: SlotConfiguration, argumentSize:Size) diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/BaseRelationshipSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/BaseRelationshipSlottedPipe.scala index bcc1d2a4c50f8..3666d47326db6 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/BaseRelationshipSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/BaseRelationshipSlottedPipe.scala @@ -27,8 +27,8 @@ import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.pipes.{LazyType, Pipe, PipeWithSource, QueryState} import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, IsMap, makeValueNeoSafe} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.{CypherTypeException, InvalidSemanticsException} +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.{CypherTypeException, InvalidSemanticsException} import org.neo4j.graphdb.{Node, Relationship} import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/CartesianProductSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/CartesianProductSlottedPipe.scala index 34e82176e0a91..c780e531ff8ca 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/CartesianProductSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/CartesianProductSlottedPipe.scala @@ -23,7 +23,7 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.SlotConfiguration import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, QueryState} import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class CartesianProductSlottedPipe(lhs: Pipe, rhs: Pipe, lhsLongCount: Int, lhsRefCount: Int, diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ConditionalApplySlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ConditionalApplySlottedPipe.scala index 688558c65f31a..af34b6789f1db 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ConditionalApplySlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ConditionalApplySlottedPipe.scala @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, PipeWithSource, QueryState} import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext import org.neo4j.cypher.internal.runtime.slotted.helpers.NullChecker -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.storable.Values case class ConditionalApplySlottedPipe(lhs: Pipe, diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/CreateNodeSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/CreateNodeSlottedPipe.scala index 0d93d08c524a6..b80084bd10986 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/CreateNodeSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/CreateNodeSlottedPipe.scala @@ -26,8 +26,8 @@ import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.pipes.{LazyLabel, Pipe, PipeWithSource, QueryState} import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, IsMap, makeValueNeoSafe} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.{CypherTypeException, InvalidSemanticsException} +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.{CypherTypeException, InvalidSemanticsException} import org.neo4j.graphdb.{Node, Relationship} import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/DistinctSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/DistinctSlottedPipe.scala index e8c1f9bc60112..98a1ed5bca817 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/DistinctSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/DistinctSlottedPipe.scala @@ -25,7 +25,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expres import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, PipeWithSource, QueryState} import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext import org.neo4j.cypher.internal.runtime.slotted.helpers.SlottedPipeBuilderUtils -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.AnyValue import org.neo4j.values.virtual.VirtualValues diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/DistinctSlottedPrimitivePipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/DistinctSlottedPrimitivePipe.scala index 449c2e3d64c06..1d15d1b97b660 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/DistinctSlottedPrimitivePipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/DistinctSlottedPrimitivePipe.scala @@ -26,7 +26,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, PipeWithSource import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext import org.neo4j.cypher.internal.runtime.slotted.helpers.SlottedPipeBuilderUtils import org.neo4j.cypher.internal.runtime.{LongArraySet, PrefetchingIterator} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import scala.collection.immutable diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/DistinctSlottedSinglePrimitivePipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/DistinctSlottedSinglePrimitivePipe.scala index 784d48ee47465..5d7557526babf 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/DistinctSlottedSinglePrimitivePipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/DistinctSlottedSinglePrimitivePipe.scala @@ -27,7 +27,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expres import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, PipeWithSource, QueryState} import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext import org.neo4j.cypher.internal.runtime.slotted.helpers.SlottedPipeBuilderUtils.makeSetValueInSlotFunctionFor -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.AnyValue case class DistinctSlottedSinglePrimitivePipe(source: Pipe, diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/EagerAggregationSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/EagerAggregationSlottedPipe.scala index c3d33ca933a95..f27422955ab2d 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/EagerAggregationSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/EagerAggregationSlottedPipe.scala @@ -26,7 +26,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation.Aggregati import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, PipeWithSource, QueryState} import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext import org.neo4j.cypher.internal.runtime.slotted.helpers.SlottedPipeBuilderUtils -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.AnyValue import org.neo4j.values.virtual.{ListValue, MapValue, VirtualValues} diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/EagerAggregationWithoutGroupingSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/EagerAggregationWithoutGroupingSlottedPipe.scala index bbd93f69b69ef..fe88520812ec8 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/EagerAggregationWithoutGroupingSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/EagerAggregationWithoutGroupingSlottedPipe.scala @@ -25,7 +25,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Aggreg import org.neo4j.cypher.internal.runtime.interpreted.pipes.aggregation.AggregationFunction import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, PipeWithSource, QueryState} import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id /* This pipe can be used whenever we are aggregating and not grouping on anything diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/EagerSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/EagerSlottedPipe.scala index 6a9559fc34a32..3a21f6a349774 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/EagerSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/EagerSlottedPipe.scala @@ -23,7 +23,7 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.SlotConfiguration import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, PipeWithSource, QueryState} import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class EagerSlottedPipe(source: Pipe, slots: SlotConfiguration)(val id: Id = Id.INVALID_ID) extends PipeWithSource(source) { diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ExpandAllSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ExpandAllSlottedPipe.scala index 33933be5705cd..8ed72bb259efe 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ExpandAllSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ExpandAllSlottedPipe.scala @@ -26,9 +26,9 @@ import org.neo4j.cypher.internal.runtime.interpreted.pipes._ import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext import org.neo4j.cypher.internal.runtime.slotted.helpers.NullChecker import org.neo4j.cypher.internal.runtime.slotted.helpers.SlottedPipeBuilderUtils.makeGetPrimitiveNodeFromSlotFunctionFor -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.kernel.impl.api.RelationshipVisitor import org.neo4j.kernel.impl.api.store.RelationshipIterator diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ExpandIntoSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ExpandIntoSlottedPipe.scala index 4f33cac925a81..ad8821ab02f03 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ExpandIntoSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ExpandIntoSlottedPipe.scala @@ -27,8 +27,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.pipes._ import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext import org.neo4j.cypher.internal.runtime.slotted.helpers.NullChecker.entityIsNull import org.neo4j.cypher.internal.runtime.slotted.helpers.SlottedPipeBuilderUtils.makeGetPrimitiveNodeFromSlotFunctionFor -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.expressions.SemanticDirection /** * Expand when both end-points are known, find all relationships of the given diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ForeachSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ForeachSlottedPipe.scala index 4b5d6d76f60c7..14ad12eb21287 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ForeachSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ForeachSlottedPipe.scala @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.runtime.slotted.helpers.SlottedPipeBuilderUtils import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, PipeWithSource, QueryState} import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, ListSupport} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import scala.collection.JavaConverters._ diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/NodeHashJoinSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/NodeHashJoinSlottedPipe.scala index 91791e4e51358..d147a29b645d4 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/NodeHashJoinSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/NodeHashJoinSlottedPipe.scala @@ -26,7 +26,7 @@ import org.neo4j.cypher.internal.runtime.slotted.helpers.NullChecker.entityIsNul import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, QueryState} import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class NodeHashJoinSlottedPipe(leftSide: Array[Int], rightSide: Array[Int], diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/NodeIndexScanSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/NodeIndexScanSlottedPipe.scala index 3c29ebc631569..f91102ba4f13b 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/NodeIndexScanSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/NodeIndexScanSlottedPipe.scala @@ -25,8 +25,8 @@ import org.neo4j.cypher.internal.runtime.QueryContext import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes._ import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.v3_5.expressions.{LabelToken, PropertyKeyToken} +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.expressions.{LabelToken, PropertyKeyToken} import org.neo4j.internal.kernel.api.{CapableIndexReference, IndexReference} case class NodeIndexScanSlottedPipe(ident: String, diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/NodeIndexSeekSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/NodeIndexSeekSlottedPipe.scala index 916b6bf93507e..9ea73e10f69a8 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/NodeIndexSeekSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/NodeIndexSeekSlottedPipe.scala @@ -25,8 +25,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.pipes._ import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.v3_5.expressions.{LabelToken, PropertyKeyToken} +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.expressions.{LabelToken, PropertyKeyToken} import org.neo4j.cypher.internal.v3_5.logical.plans.QueryExpression import org.neo4j.internal.kernel.api.{CapableIndexReference, IndexReference} diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/NodesByLabelScanSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/NodesByLabelScanSlottedPipe.scala index f31251650bbe7..7c8466fdf7af6 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/NodesByLabelScanSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/NodesByLabelScanSlottedPipe.scala @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.helpers.PrimitiveLon import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.{LazyLabel, Pipe, QueryState} import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class NodesByLabelScanSlottedPipe(ident: String, label: LazyLabel, diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/OptionalExpandAllSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/OptionalExpandAllSlottedPipe.scala index 63e0b5370070a..34c2ec137bd3c 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/OptionalExpandAllSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/OptionalExpandAllSlottedPipe.scala @@ -27,9 +27,9 @@ import org.neo4j.cypher.internal.runtime.interpreted.pipes._ import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext import org.neo4j.cypher.internal.runtime.slotted.helpers.NullChecker import org.neo4j.cypher.internal.runtime.slotted.helpers.SlottedPipeBuilderUtils.makeGetPrimitiveNodeFromSlotFunctionFor -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.kernel.impl.api.RelationshipVisitor import org.neo4j.kernel.impl.api.store.RelationshipIterator diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/OptionalExpandIntoSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/OptionalExpandIntoSlottedPipe.scala index 5568925f65d35..d062da881d218 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/OptionalExpandIntoSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/OptionalExpandIntoSlottedPipe.scala @@ -28,8 +28,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.pipes._ import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext import org.neo4j.cypher.internal.runtime.slotted.helpers.NullChecker.entityIsNull import org.neo4j.cypher.internal.runtime.slotted.helpers.SlottedPipeBuilderUtils.makeGetPrimitiveNodeFromSlotFunctionFor -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.expressions.SemanticDirection case class OptionalExpandIntoSlottedPipe(source: Pipe, fromSlot: Slot, diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/OptionalSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/OptionalSlottedPipe.scala index 152b95cc13276..5b18c1c7016bf 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/OptionalSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/OptionalSlottedPipe.scala @@ -23,7 +23,7 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{LongSlot, RefSlot, import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, PipeWithSource, QueryState} import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.storable.Values case class OptionalSlottedPipe(source: Pipe, diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/PrimitiveCachingExpandInto.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/PrimitiveCachingExpandInto.scala index b9556f802c80e..45cd425765f76 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/PrimitiveCachingExpandInto.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/PrimitiveCachingExpandInto.scala @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal.runtime.slotted.pipes import org.eclipse.collections.api.iterator.LongIterator import org.neo4j.cypher.internal.runtime.QueryContext -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.kernel.impl.api.RelationshipVisitor import org.neo4j.kernel.impl.api.store.RelationshipIterator diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ProduceResultSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ProduceResultSlottedPipe.scala index 995db53a521ae..ec1e015e8c977 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ProduceResultSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ProduceResultSlottedPipe.scala @@ -23,7 +23,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expres import org.neo4j.cypher.internal.runtime.interpreted.pipes._ import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.slotted.ArrayResultExecutionContextFactory -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class ProduceResultSlottedPipe(source: Pipe, columns: Seq[(String, Expression)]) (val id: Id = Id.INVALID_ID) extends PipeWithSource(source) with Pipe { diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ProjectionSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ProjectionSlottedPipe.scala index fdbccb9e33026..0df8be1ce5d92 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ProjectionSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ProjectionSlottedPipe.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.slotted.pipes import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, PipeWithSource, QueryState} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id /* Projection evaluates expressions and stores their values into new slots in the execution context. diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/RollUpApplySlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/RollUpApplySlottedPipe.scala index e0ec6e76dda52..348ec071148b3 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/RollUpApplySlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/RollUpApplySlottedPipe.scala @@ -23,7 +23,7 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{LongSlot, RefSlot, import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, PipeWithSource, QueryState} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.storable.Values.NO_VALUE import org.neo4j.values.virtual.VirtualValues diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/SortSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/SortSlottedPipe.scala index 088fad88eb3b4..4c0bf1e153d24 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/SortSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/SortSlottedPipe.scala @@ -24,7 +24,7 @@ import java.util.Comparator import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{LongSlot, RefSlot, Slot, SlotConfiguration} import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, PipeWithSource, QueryState} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.{AnyValue, AnyValues} case class SortSlottedPipe(source: Pipe, diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/TopSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/TopSlottedPipe.scala index d5d098c2a7ab2..61bf20713ca1f 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/TopSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/TopSlottedPipe.scala @@ -25,7 +25,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, PipeWithSource, QueryState} import org.neo4j.cypher.internal.runtime.slotted.DefaultComparatorTopTable -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.storable.NumberValue import scala.collection.JavaConverters._ diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/UnionSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/UnionSlottedPipe.scala index 4363bba85c352..d166f77ffb7a5 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/UnionSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/UnionSlottedPipe.scala @@ -22,7 +22,7 @@ package org.neo4j.cypher.internal.runtime.slotted.pipes import org.neo4j.cypher.internal.runtime.slotted.SlottedPipeBuilder.RowMapping import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, QueryState} -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id case class UnionSlottedPipe(lhs: Pipe, rhs: Pipe, lhsMapping: RowMapping, diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/UnwindSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/UnwindSlottedPipe.scala index 8bde1d3baa8ae..583fbbb02313b 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/UnwindSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/UnwindSlottedPipe.scala @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expres import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, PipeWithSource, QueryState} import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, ListSupport} import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.AnyValue import scala.annotation.tailrec diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ValueHashJoinSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ValueHashJoinSlottedPipe.scala index f4fd50c5dcfe1..dcbf0ab57d12e 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ValueHashJoinSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ValueHashJoinSlottedPipe.scala @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, QueryState} import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values.NO_VALUE diff --git a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/VarLengthExpandSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/VarLengthExpandSlottedPipe.scala index bb00fa80a8bbf..8708f5a3bb328 100644 --- a/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/VarLengthExpandSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/VarLengthExpandSlottedPipe.scala @@ -26,9 +26,9 @@ import org.neo4j.cypher.internal.runtime.interpreted.pipes.{LazyTypes, Pipe, Pip import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext import org.neo4j.cypher.internal.runtime.slotted.helpers.NullChecker.entityIsNull import org.neo4j.cypher.internal.runtime.slotted.helpers.SlottedPipeBuilderUtils.makeGetPrimitiveNodeFromSlotFunctionFor -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.v3_5.expressions.SemanticDirection +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.expressions.SemanticDirection import org.neo4j.kernel.impl.api.RelationshipVisitor import org.neo4j.kernel.impl.api.store.RelationshipIterator import org.neo4j.values.storable.Values diff --git a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/PrimitiveExecutionContextTest.scala b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/PrimitiveExecutionContextTest.scala index 3d221135aebb1..eb7f9f7d4f143 100644 --- a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/PrimitiveExecutionContextTest.scala +++ b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/PrimitiveExecutionContextTest.scala @@ -20,8 +20,8 @@ package org.neo4j.cypher.internal.runtime.slotted import org.neo4j.cypher.internal.compatibility.v3_5.runtime.SlotConfiguration -import org.neo4j.cypher.internal.util.v3_5.InternalException -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.InternalException +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.stringValue class PrimitiveExecutionContextTest extends CypherFunSuite { diff --git a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/SlottedPipeBuilderTest.scala b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/SlottedPipeBuilderTest.scala index 91d2084d07eef..6612206d30a0e 100644 --- a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/SlottedPipeBuilderTest.scala +++ b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/SlottedPipeBuilderTest.scala @@ -27,7 +27,7 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.SlotConfiguration.Si import org.neo4j.cypher.internal.compatibility.v3_5.runtime._ import org.neo4j.cypher.internal.compiler.v3_5.planner.logical.Metrics import org.neo4j.cypher.internal.compiler.v3_5.planner.{HardcodedGraphStatistics, LogicalPlanningTestSupport2} -import org.neo4j.cypher.internal.frontend.v3_5.semantics.SemanticTable +import org.opencypher.v9_0.ast.semantics.SemanticTable import org.neo4j.cypher.internal.ir.v3_5.VarPatternLength import org.neo4j.cypher.internal.planner.v3_5.spi.{IDPPlannerName, PlanContext} import org.neo4j.cypher.internal.runtime.interpreted.commands @@ -39,10 +39,10 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.values.TokenType.P import org.neo4j.cypher.internal.runtime.interpreted.pipes._ import org.neo4j.cypher.internal.runtime.slotted.expressions.{NodeProperty, RelationshipProperty, SlottedExpressionConverters} import org.neo4j.cypher.internal.runtime.slotted.pipes._ -import org.neo4j.cypher.internal.util.v3_5.symbols.{CTAny, CTList, CTNode, CTRelationship} -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite -import org.neo4j.cypher.internal.util.v3_5.{LabelId, PropertyKeyId} -import org.neo4j.cypher.internal.v3_5.expressions._ +import org.opencypher.v9_0.util.symbols.{CTAny, CTList, CTNode, CTRelationship} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.{LabelId, PropertyKeyId} +import org.opencypher.v9_0.expressions._ import org.neo4j.cypher.internal.v3_5.logical.plans import org.neo4j.cypher.internal.v3_5.logical.plans._ diff --git a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/helpers/SlottedPipeBuilderUtilsTest.scala b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/helpers/SlottedPipeBuilderUtilsTest.scala index 0a023f0683e1f..3ee8815399f58 100644 --- a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/helpers/SlottedPipeBuilderUtilsTest.scala +++ b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/helpers/SlottedPipeBuilderUtilsTest.scala @@ -22,10 +22,10 @@ package org.neo4j.cypher.internal.runtime.slotted.helpers import SlottedPipeBuilderUtils._ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{Slot, SlotConfiguration} import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext -import org.neo4j.cypher.internal.util.v3_5.AssertionUtils._ -import org.neo4j.cypher.internal.util.v3_5.ParameterWrongTypeException -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.AssertionUtils._ +import org.opencypher.v9_0.util.ParameterWrongTypeException +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.AnyValue import org.neo4j.values.storable.Values import org.neo4j.values.virtual.VirtualValues diff --git a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/FakeSlottedPipe.scala b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/FakeSlottedPipe.scala index e01a38b7b6c47..0c2413e08ab26 100644 --- a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/FakeSlottedPipe.scala +++ b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/FakeSlottedPipe.scala @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.ValueConversion.asValue import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, QueryState} import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id +import org.opencypher.v9_0.util.attribution.Id import org.scalatest.mock.MockitoSugar case class FakeSlottedPipe(data: Iterator[Map[String, Any]], slots: SlotConfiguration) diff --git a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/HashJoinSlottedPipeTestHelper.scala b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/HashJoinSlottedPipeTestHelper.scala index 08e2724d4b53d..f211e570b6f87 100644 --- a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/HashJoinSlottedPipeTestHelper.scala +++ b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/HashJoinSlottedPipeTestHelper.scala @@ -27,7 +27,7 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.{LongSlot, RefSlot, import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext import org.neo4j.cypher.internal.runtime.interpreted.pipes.Pipe import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.AnyValue object HashJoinSlottedPipeTestHelper extends CypherFunSuite { diff --git a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/NodeHashJoinSlottedPipeTest.scala b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/NodeHashJoinSlottedPipeTest.scala index af7dac5b73dfc..4a3a0e9d0b490 100644 --- a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/NodeHashJoinSlottedPipeTest.scala +++ b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/NodeHashJoinSlottedPipeTest.scala @@ -25,8 +25,8 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.SlotConfiguration import org.neo4j.cypher.internal.runtime.slotted.pipes.HashJoinSlottedPipeTestHelper.{RowL, mockPipeFor, testableResult} import org.neo4j.cypher.internal.runtime.interpreted.pipes.Pipe import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class NodeHashJoinSlottedPipeTest extends CypherFunSuite { diff --git a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ProduceResultSlottedPipeStressTest.scala b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ProduceResultSlottedPipeStressTest.scala index 30c9c2d59f18d..a851121657fa5 100644 --- a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ProduceResultSlottedPipeStressTest.scala +++ b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ProduceResultSlottedPipeStressTest.scala @@ -26,9 +26,9 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Litera import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, QueryState} import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext -import org.neo4j.cypher.internal.util.v3_5.attribution.Id -import org.neo4j.cypher.internal.util.v3_5.symbols.CTNode -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.attribution.Id +import org.opencypher.v9_0.util.symbols.CTNode +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.cypher.result.QueryResult import org.neo4j.cypher.result.QueryResult.Record import org.neo4j.values.AnyValue diff --git a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/RollUpApplySlottedPipeTest.scala b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/RollUpApplySlottedPipeTest.scala index 8f649411919a4..a3c26f5cac959 100644 --- a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/RollUpApplySlottedPipeTest.scala +++ b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/RollUpApplySlottedPipeTest.scala @@ -30,8 +30,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.pipes.{Pipe, PipeTestSuppor import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, QueryStateHelper} import org.neo4j.cypher.internal.runtime.slotted.expressions.{NodeFromSlot, ReferenceFromSlot} import org.neo4j.cypher.internal.runtime.{Operations, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.kernel.impl.util.ValueUtils.fromNodeProxy import org.neo4j.values.storable.Values import org.neo4j.values.storable.Values.NO_VALUE diff --git a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/Top1WithTiesSlottedPipeTest.scala b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/Top1WithTiesSlottedPipeTest.scala index 81fe076194f67..6697b9b9a10a5 100644 --- a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/Top1WithTiesSlottedPipeTest.scala +++ b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/Top1WithTiesSlottedPipeTest.scala @@ -20,7 +20,7 @@ package org.neo4j.cypher.internal.runtime.slotted.pipes import org.neo4j.cypher.internal.runtime.slotted.pipes.TopSlottedPipeTestSupport._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite class Top1WithTiesSlottedPipeTest extends CypherFunSuite { diff --git a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/TopSlottedPipeTest.scala b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/TopSlottedPipeTest.scala index cf7a6dfc2b274..181091fa28701 100644 --- a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/TopSlottedPipeTest.scala +++ b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/TopSlottedPipeTest.scala @@ -26,8 +26,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Litera import org.neo4j.cypher.internal.runtime.interpreted.pipes.Pipe import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext import org.neo4j.cypher.internal.runtime.slotted.pipes.TopSlottedPipeTestSupport._ -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.kernel.impl.util.ValueUtils import scala.util.Random diff --git a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/UnionSlottedPipeTest.scala b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/UnionSlottedPipeTest.scala index 921c1fb6d3ebb..9b669499759c9 100644 --- a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/UnionSlottedPipeTest.scala +++ b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/UnionSlottedPipeTest.scala @@ -28,8 +28,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext import org.neo4j.cypher.internal.runtime.slotted.SlottedPipeBuilder.computeUnionMapping import org.neo4j.cypher.internal.runtime.{Operations, QueryContext} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.graphdb.{Node, Relationship} import org.neo4j.kernel.impl.util.ValueUtils.{fromNodeProxy, fromRelationshipProxy} import org.neo4j.values.storable.Values.{longValue, stringArray, stringValue} diff --git a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/UnwindSlottedPipeTest.scala b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/UnwindSlottedPipeTest.scala index 13803bd58b24c..b329806dee90b 100644 --- a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/UnwindSlottedPipeTest.scala +++ b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/UnwindSlottedPipeTest.scala @@ -23,8 +23,8 @@ import org.neo4j.cypher.internal.compatibility.v3_5.runtime.SlotConfiguration import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper import org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext import org.neo4j.cypher.internal.runtime.slotted.expressions.ReferenceFromSlot -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.intValue import org.neo4j.values.virtual.VirtualValues.list diff --git a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ValueHashJoinSlottedPipeTest.scala b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ValueHashJoinSlottedPipeTest.scala index 65da6a17aa51e..d64cc4919985f 100644 --- a/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ValueHashJoinSlottedPipeTest.scala +++ b/enterprise/cypher/slotted-runtime/src/test/scala/org/neo4j/cypher/internal/runtime/slotted/pipes/ValueHashJoinSlottedPipeTest.scala @@ -26,8 +26,8 @@ import org.neo4j.cypher.internal.runtime.interpreted.QueryStateHelper import org.neo4j.cypher.internal.runtime.interpreted.pipes.Pipe import org.neo4j.cypher.internal.runtime.slotted.expressions.ReferenceFromSlot import org.neo4j.cypher.internal.runtime.slotted.pipes.HashJoinSlottedPipeTestHelper.{Longs, Refs, RowR, RowRL, mockPipeFor, testableResult} -import org.neo4j.cypher.internal.util.v3_5.symbols._ -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite +import org.opencypher.v9_0.util.symbols._ +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite import org.neo4j.values.storable.Values.{NO_VALUE, intValue, stringValue} class ValueHashJoinSlottedPipeTest extends CypherFunSuite { diff --git a/enterprise/cypher/spec-suite-tools/LICENSES.txt b/enterprise/cypher/spec-suite-tools/LICENSES.txt index 32263387da460..4bec695ea6622 100644 --- a/enterprise/cypher/spec-suite-tools/LICENSES.txt +++ b/enterprise/cypher/spec-suite-tools/LICENSES.txt @@ -20,8 +20,14 @@ Apache Software License, Version 2.0 MongoDB Java Driver Netty/All-in-One nscala-time + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting openCypher TCK API openCypher TCK Features and Graphs + openCypher Utils org.apiguardian:apiguardian-api parboiled-core parboiled-scala diff --git a/enterprise/cypher/spec-suite-tools/NOTICE.txt b/enterprise/cypher/spec-suite-tools/NOTICE.txt index 56fba3c1f5e90..8b3d0a18bf572 100644 --- a/enterprise/cypher/spec-suite-tools/NOTICE.txt +++ b/enterprise/cypher/spec-suite-tools/NOTICE.txt @@ -42,8 +42,14 @@ Apache Software License, Version 2.0 MongoDB Java Driver Netty/All-in-One nscala-time + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting openCypher TCK API openCypher TCK Features and Graphs + openCypher Utils org.apiguardian:apiguardian-api parboiled-core parboiled-scala diff --git a/enterprise/cypher/spec-suite-tools/src/test/scala/cypher/features/Neo4jProcedureAdapter.scala b/enterprise/cypher/spec-suite-tools/src/test/scala/cypher/features/Neo4jProcedureAdapter.scala index d81a7781f6cae..977f133d6409a 100644 --- a/enterprise/cypher/spec-suite-tools/src/test/scala/cypher/features/Neo4jProcedureAdapter.scala +++ b/enterprise/cypher/spec-suite-tools/src/test/scala/cypher/features/Neo4jProcedureAdapter.scala @@ -20,7 +20,7 @@ package cypher.features import org.neo4j.collection.RawIterator -import org.neo4j.cypher.internal.util.v3_5.symbols.{CTBoolean, CTFloat, CTInteger, CTMap, CTNode, CTNumber, CTPath, CTRelationship, CTString, CypherType, ListType} +import org.opencypher.v9_0.util.symbols.{CTBoolean, CTFloat, CTInteger, CTMap, CTNode, CTNumber, CTPath, CTRelationship, CTString, CypherType, ListType} import org.neo4j.internal.kernel.api.exceptions.ProcedureException import org.neo4j.internal.kernel.api.procs import org.neo4j.internal.kernel.api.procs.Neo4jTypes diff --git a/enterprise/cypher/spec-suite-tools/src/test/scala/cypher/features/ProcedureSignature.scala b/enterprise/cypher/spec-suite-tools/src/test/scala/cypher/features/ProcedureSignature.scala index d752d5591b106..2a470069507a4 100644 --- a/enterprise/cypher/spec-suite-tools/src/test/scala/cypher/features/ProcedureSignature.scala +++ b/enterprise/cypher/spec-suite-tools/src/test/scala/cypher/features/ProcedureSignature.scala @@ -19,7 +19,7 @@ */ package cypher.features -import org.neo4j.cypher.internal.util.v3_5.symbols.CypherType +import org.opencypher.v9_0.util.symbols.CypherType case class ProcedureSignature(namespace: Seq[String], name: String, diff --git a/enterprise/cypher/spec-suite-tools/src/test/scala/cypher/features/ProcedureSignatureParser.scala b/enterprise/cypher/spec-suite-tools/src/test/scala/cypher/features/ProcedureSignatureParser.scala index 19dc49e32707b..b5352ac7426c6 100644 --- a/enterprise/cypher/spec-suite-tools/src/test/scala/cypher/features/ProcedureSignatureParser.scala +++ b/enterprise/cypher/spec-suite-tools/src/test/scala/cypher/features/ProcedureSignatureParser.scala @@ -20,9 +20,9 @@ package cypher.features import cypher.features -import org.neo4j.cypher.internal.frontend.v3_5.parser.{Base, Expressions, Literals} -import org.neo4j.cypher.internal.util.v3_5.SyntaxException -import org.neo4j.cypher.internal.util.v3_5.symbols._ +import org.opencypher.v9_0.parser.{Base, Expressions, Literals} +import org.opencypher.v9_0.util.SyntaxException +import org.opencypher.v9_0.util.symbols._ import org.parboiled.scala._ /** diff --git a/enterprise/kernel/pom.xml b/enterprise/kernel/pom.xml index e689371dbbd87..c88c301f6f407 100644 --- a/enterprise/kernel/pom.xml +++ b/enterprise/kernel/pom.xml @@ -115,13 +115,6 @@ test-jar test - - org.neo4j - neo4j-cypher-util-3.5 - ${project.version} - test-jar - test - org.neo4j neo4j-shell @@ -169,6 +162,14 @@ test-jar test + + org.opencypher + util-9.0 + 1.0.0 + test-jar + test + + org.neo4j neo4j-random-values diff --git a/enterprise/kernel/src/test/scala/org/neo4j/cypher/EnterpriseGraphDatabaseTestSupport.scala b/enterprise/kernel/src/test/scala/org/neo4j/cypher/EnterpriseGraphDatabaseTestSupport.scala index 30f3934041b08..8e390c301d3a1 100644 --- a/enterprise/kernel/src/test/scala/org/neo4j/cypher/EnterpriseGraphDatabaseTestSupport.scala +++ b/enterprise/kernel/src/test/scala/org/neo4j/cypher/EnterpriseGraphDatabaseTestSupport.scala @@ -19,8 +19,8 @@ */ package org.neo4j.cypher -import org.neo4j.cypher.internal.util.v3_5.test_helpers.CypherFunSuite import org.neo4j.test.{TestEnterpriseGraphDatabaseFactory, TestGraphDatabaseFactory} +import org.opencypher.v9_0.util.test_helpers.CypherFunSuite trait EnterpriseGraphDatabaseTestSupport extends GraphDatabaseTestSupport { self: CypherFunSuite => diff --git a/enterprise/neo4j-enterprise/LICENSES.txt b/enterprise/neo4j-enterprise/LICENSES.txt index f73c43926b50f..1655dd3a5e70f 100644 --- a/enterprise/neo4j-enterprise/LICENSES.txt +++ b/enterprise/neo4j-enterprise/LICENSES.txt @@ -37,6 +37,12 @@ Apache Software License, Version 2.0 Netty/All-in-One Objenesis opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala Prometheus Java Simpleclient diff --git a/enterprise/neo4j-enterprise/NOTICE.txt b/enterprise/neo4j-enterprise/NOTICE.txt index f8fc537cb0494..ad9e05a39b1a2 100644 --- a/enterprise/neo4j-enterprise/NOTICE.txt +++ b/enterprise/neo4j-enterprise/NOTICE.txt @@ -59,6 +59,12 @@ Apache Software License, Version 2.0 Netty/All-in-One Objenesis opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala Prometheus Java Simpleclient diff --git a/enterprise/neo4j-harness-enterprise/LICENSES.txt b/enterprise/neo4j-harness-enterprise/LICENSES.txt index 21cd5f199e1c5..6a3f663d583ca 100644 --- a/enterprise/neo4j-harness-enterprise/LICENSES.txt +++ b/enterprise/neo4j-harness-enterprise/LICENSES.txt @@ -51,6 +51,12 @@ Apache Software License, Version 2.0 Netty/All-in-One Objenesis opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala Prometheus Java Simpleclient diff --git a/enterprise/neo4j-harness-enterprise/NOTICE.txt b/enterprise/neo4j-harness-enterprise/NOTICE.txt index 7594463a5c292..bf011956782b1 100644 --- a/enterprise/neo4j-harness-enterprise/NOTICE.txt +++ b/enterprise/neo4j-harness-enterprise/NOTICE.txt @@ -73,6 +73,12 @@ Apache Software License, Version 2.0 Netty/All-in-One Objenesis opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala Prometheus Java Simpleclient diff --git a/enterprise/server-enterprise/LICENSES.txt b/enterprise/server-enterprise/LICENSES.txt index 69c0ecc79f603..89a1d09acbe6e 100644 --- a/enterprise/server-enterprise/LICENSES.txt +++ b/enterprise/server-enterprise/LICENSES.txt @@ -51,6 +51,12 @@ Apache Software License, Version 2.0 Netty/All-in-One Objenesis opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala Prometheus Java Simpleclient diff --git a/enterprise/server-enterprise/NOTICE.txt b/enterprise/server-enterprise/NOTICE.txt index 9a24cf458830d..73466f895ff3b 100644 --- a/enterprise/server-enterprise/NOTICE.txt +++ b/enterprise/server-enterprise/NOTICE.txt @@ -73,6 +73,12 @@ Apache Software License, Version 2.0 Netty/All-in-One Objenesis opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala Prometheus Java Simpleclient diff --git a/packaging/standalone/standalone-community/src/main/distribution/text/community/LICENSES.txt b/packaging/standalone/standalone-community/src/main/distribution/text/community/LICENSES.txt index 27aec755a74c9..74dc04561c571 100644 --- a/packaging/standalone/standalone-community/src/main/distribution/text/community/LICENSES.txt +++ b/packaging/standalone/standalone-community/src/main/distribution/text/community/LICENSES.txt @@ -38,6 +38,12 @@ Apache Software License, Version 2.0 Netty/All-in-One Objenesis opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala rxjs.js diff --git a/packaging/standalone/standalone-community/src/main/distribution/text/community/NOTICE.txt b/packaging/standalone/standalone-community/src/main/distribution/text/community/NOTICE.txt index f23a76aa0a66b..1f0d052f51fff 100644 --- a/packaging/standalone/standalone-community/src/main/distribution/text/community/NOTICE.txt +++ b/packaging/standalone/standalone-community/src/main/distribution/text/community/NOTICE.txt @@ -61,6 +61,12 @@ Apache Software License, Version 2.0 Netty/All-in-One Objenesis opencsv + openCypher AST for the Cypher Query Language + openCypher Expressions + openCypher Front End + openCypher Parser + openCypher Rewriting + openCypher Utils parboiled-core parboiled-scala rxjs.js