Skip to content

Commit

Permalink
Created 3.3 compiler module
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusmelke committed May 8, 2017
1 parent e58baf9 commit ca81421
Show file tree
Hide file tree
Showing 979 changed files with 2,707 additions and 2,868 deletions.
Expand Up @@ -8,11 +8,11 @@
</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>neo4j-cypher-compiler-3.2</artifactId>
<artifactId>neo4j-cypher-compiler-3.3</artifactId>
<packaging>jar</packaging>
<version>3.3.0-SNAPSHOT</version>
<name>Neo4j - Cypher Compiler 3.2</name>
<description>Compiler for Cypher 3.2</description>
<name>Neo4j - Cypher Compiler 3.3</name>
<description>Compiler for Cypher 3.3</description>
<url>http://components.neo4j.org/${project.artifactId}/${project.version}</url>

<scm>
Expand Down
Expand Up @@ -17,13 +17,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2;
package org.neo4j.cypher.internal.compiler.v3_3;

import java.util.HashMap;
import java.util.Map;
import java.util.NoSuchElementException;

import org.neo4j.cypher.internal.compiler.v3_2.spi.InternalResultRow;
import org.neo4j.cypher.internal.compiler.v3_3.spi.InternalResultRow;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Path;
import org.neo4j.graphdb.Relationship;
Expand Down
Expand Up @@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2.common;
package org.neo4j.cypher.internal.compiler.v3_3.common;

import java.util.Arrays;
import java.util.Comparator;
Expand All @@ -28,8 +28,8 @@
import java.util.stream.IntStream;
import java.util.stream.LongStream;

import org.neo4j.cypher.internal.compiler.v3_2.spi.NodeIdWrapper;
import org.neo4j.cypher.internal.compiler.v3_2.spi.RelationshipIdWrapper;
import org.neo4j.cypher.internal.compiler.v3_3.spi.NodeIdWrapper;
import org.neo4j.cypher.internal.compiler.v3_3.spi.RelationshipIdWrapper;
import org.neo4j.cypher.internal.frontend.v3_2.IncomparableValuesException;
import org.neo4j.cypher.internal.frontend.v3_2.UnorderableValueException;
import org.neo4j.graphdb.Path;
Expand Down
Expand Up @@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2.spi;
package org.neo4j.cypher.internal.compiler.v3_3.spi;

import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Path;
Expand Down
Expand Up @@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2.spi;
package org.neo4j.cypher.internal.compiler.v3_3.spi;

public interface InternalResultVisitor<VisitationException extends Exception>
{
Expand Down
Expand Up @@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2.spi;
package org.neo4j.cypher.internal.compiler.v3_3.spi;

public interface NodeIdWrapper
{
Expand Down
Expand Up @@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2.spi;
package org.neo4j.cypher.internal.compiler.v3_3.spi;

public interface RelationshipIdWrapper
{
Expand Down
Expand Up @@ -17,15 +17,14 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2
package org.neo4j.cypher.internal.compiler.v3_3

import org.neo4j.cypher.internal.compiler.v3_2.commands._
import org.neo4j.cypher.internal.compiler.v3_2.commands.expressions.{Expression, Variable}
import org.neo4j.cypher.internal.compiler.v3_2.commands.values.KeyToken
import org.neo4j.cypher.internal.compiler.v3_2.mutation.GraphElementPropertyFunctions
import org.neo4j.cypher.internal.frontend.v3_2.SyntaxException
import org.neo4j.cypher.internal.compiler.v3_3.commands._
import org.neo4j.cypher.internal.compiler.v3_3.commands.expressions.{Expression, Variable}
import org.neo4j.cypher.internal.compiler.v3_3.commands.values.KeyToken
import org.neo4j.cypher.internal.compiler.v3_3.mutation.GraphElementPropertyFunctions
import org.neo4j.cypher.internal.frontend.v3_2.{SemanticDirection, SyntaxException}
import org.neo4j.cypher.internal.frontend.v3_2.symbols._
import org.neo4j.cypher.internal.frontend.v3_2.SemanticDirection

import scala.collection.Map

Expand Down
Expand Up @@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2
package org.neo4j.cypher.internal.compiler.v3_3

import org.neo4j.cypher.internal.frontend.v3_2.Bound

Expand Down
Expand Up @@ -17,15 +17,15 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2

import org.neo4j.cypher.internal.compiler.v3_2.executionplan.{PipeInfo, _}
import org.neo4j.cypher.internal.compiler.v3_2.phases._
import org.neo4j.cypher.internal.compiler.v3_2.pipes.Pipe
import org.neo4j.cypher.internal.compiler.v3_2.planner.execution.{PipeExecutionBuilderContext, PipeExecutionPlanBuilder}
import org.neo4j.cypher.internal.compiler.v3_2.planner.logical.LogicalPlanIdentificationBuilder
import org.neo4j.cypher.internal.compiler.v3_2.profiler.Profiler
import org.neo4j.cypher.internal.compiler.v3_2.spi.{GraphStatistics, PlanContext, QueryContext, UpdateCountingQueryContext}
package org.neo4j.cypher.internal.compiler.v3_3

import org.neo4j.cypher.internal.compiler.v3_3.executionplan.{PipeInfo, _}
import org.neo4j.cypher.internal.compiler.v3_3.phases._
import org.neo4j.cypher.internal.compiler.v3_3.pipes.Pipe
import org.neo4j.cypher.internal.compiler.v3_3.planner.execution.{PipeExecutionBuilderContext, PipeExecutionPlanBuilder}
import org.neo4j.cypher.internal.compiler.v3_3.planner.logical.LogicalPlanIdentificationBuilder
import org.neo4j.cypher.internal.compiler.v3_3.profiler.Profiler
import org.neo4j.cypher.internal.compiler.v3_3.spi.{GraphStatistics, PlanContext, QueryContext, UpdateCountingQueryContext}
import org.neo4j.cypher.internal.frontend.v3_2.PeriodicCommitInOpenTransactionException
import org.neo4j.cypher.internal.frontend.v3_2.notification.InternalNotification
import org.neo4j.cypher.internal.frontend.v3_2.phases.CompilationPhaseTracer.CompilationPhase.PIPE_BUILDING
Expand Down
Expand Up @@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2
package org.neo4j.cypher.internal.compiler.v3_3

trait CacheAccessor[K <: AnyRef, T <: AnyRef] {
def getOrElseUpdate(cache: LFUCache[K, T])(key: K, f: => T): T
Expand Down
Expand Up @@ -17,11 +17,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2
package org.neo4j.cypher.internal.compiler.v3_3

import org.neo4j.cypher.internal.compiler.v3_2.pipes.QueryState
import org.neo4j.cypher.internal.compiler.v3_2.spi.{NodeIdWrapper, RelationshipIdWrapper}
import org.neo4j.cypher.internal.compiler.v3_2.common.CypherOrderability
import org.neo4j.cypher.internal.compiler.v3_3.common.CypherOrderability
import org.neo4j.cypher.internal.compiler.v3_3.pipes.QueryState
import org.neo4j.cypher.internal.compiler.v3_3.spi.{NodeIdWrapper, RelationshipIdWrapper}
import org.neo4j.graphdb.{Node, Relationship}

import scala.collection.JavaConverters._
Expand Down
Expand Up @@ -17,15 +17,15 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2
package org.neo4j.cypher.internal.compiler.v3_3

import java.time.Clock

import org.neo4j.cypher.internal.compiler.v3_2.executionplan.{PlanFingerprint, PlanFingerprintReference}
import org.neo4j.cypher.internal.compiler.v3_2.helpers.RuntimeTypeConverter
import org.neo4j.cypher.internal.compiler.v3_2.phases.CompilerContext
import org.neo4j.cypher.internal.compiler.v3_2.planner.logical.{Metrics, MetricsFactory, QueryGraphSolver}
import org.neo4j.cypher.internal.compiler.v3_2.spi.PlanContext
import org.neo4j.cypher.internal.compiler.v3_3.executionplan.{PlanFingerprint, PlanFingerprintReference}
import org.neo4j.cypher.internal.compiler.v3_3.helpers.RuntimeTypeConverter
import org.neo4j.cypher.internal.compiler.v3_3.phases.CompilerContext
import org.neo4j.cypher.internal.compiler.v3_3.planner.logical.{Metrics, MetricsFactory, QueryGraphSolver}
import org.neo4j.cypher.internal.compiler.v3_3.spi.PlanContext
import org.neo4j.cypher.internal.frontend.v3_2.InputPosition
import org.neo4j.cypher.internal.frontend.v3_2.phases.{BaseContext, CompilationPhaseTracer, InternalNotificationLogger, Monitors}

Expand Down
Expand Up @@ -17,19 +17,19 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2
package org.neo4j.cypher.internal.compiler.v3_3

import java.time.Clock

import org.neo4j.cypher.internal.compiler.v3_2.executionplan._
import org.neo4j.cypher.internal.compiler.v3_2.executionplan.procs.ProcedureCallOrSchemaCommandPlanBuilder
import org.neo4j.cypher.internal.compiler.v3_2.helpers.RuntimeTypeConverter
import org.neo4j.cypher.internal.compiler.v3_2.phases.{CompilerContext, _}
import org.neo4j.cypher.internal.compiler.v3_2.planner.logical._
import org.neo4j.cypher.internal.compiler.v3_2.planner.logical.plans.LogicalPlan
import org.neo4j.cypher.internal.compiler.v3_2.planner.logical.plans.rewriter.PlanRewriter
import org.neo4j.cypher.internal.compiler.v3_2.planner.{CheckForUnresolvedTokens, ResolveTokens}
import org.neo4j.cypher.internal.compiler.v3_2.spi.PlanContext
import org.neo4j.cypher.internal.compiler.v3_3.executionplan._
import org.neo4j.cypher.internal.compiler.v3_3.executionplan.procs.ProcedureCallOrSchemaCommandPlanBuilder
import org.neo4j.cypher.internal.compiler.v3_3.helpers.RuntimeTypeConverter
import org.neo4j.cypher.internal.compiler.v3_3.phases.{CompilerContext, _}
import org.neo4j.cypher.internal.compiler.v3_3.planner.logical._
import org.neo4j.cypher.internal.compiler.v3_3.planner.logical.plans.LogicalPlan
import org.neo4j.cypher.internal.compiler.v3_3.planner.logical.plans.rewriter.PlanRewriter
import org.neo4j.cypher.internal.compiler.v3_3.planner.{CheckForUnresolvedTokens, ResolveTokens}
import org.neo4j.cypher.internal.compiler.v3_3.spi.PlanContext
import org.neo4j.cypher.internal.frontend.v3_2.InputPosition
import org.neo4j.cypher.internal.frontend.v3_2.ast.Statement
import org.neo4j.cypher.internal.frontend.v3_2.ast.rewriters.ASTRewriter
Expand Down
Expand Up @@ -17,22 +17,22 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2
package org.neo4j.cypher.internal.compiler.v3_3

import java.time.Clock

import org.neo4j.cypher.internal.compiler.v3_2.executionplan._
import org.neo4j.cypher.internal.compiler.v3_2.helpers.RuntimeTypeConverter
import org.neo4j.cypher.internal.compiler.v3_2.phases.{CompilationState, CompilerContext}
import org.neo4j.cypher.internal.compiler.v3_2.planner.logical._
import org.neo4j.cypher.internal.compiler.v3_2.planner.logical.idp._
import org.neo4j.cypher.internal.compiler.v3_3.executionplan._
import org.neo4j.cypher.internal.compiler.v3_3.helpers.RuntimeTypeConverter
import org.neo4j.cypher.internal.compiler.v3_3.phases.{CompilationState, CompilerContext}
import org.neo4j.cypher.internal.compiler.v3_3.planner.logical._
import org.neo4j.cypher.internal.compiler.v3_3.planner.logical.idp._
import org.neo4j.cypher.internal.frontend.v3_2.ast.Statement
import org.neo4j.cypher.internal.frontend.v3_2.ast.rewriters.{ASTRewriter, IfNoParameter}
import org.neo4j.cypher.internal.frontend.v3_2.helpers.rewriting.RewriterStepSequencer
import org.neo4j.cypher.internal.frontend.v3_2.phases.{Monitors, Transformer}

class CypherCompilerFactory[C <: CompilerContext, T <: Transformer[C, CompilationState, CompilationState]] {
val monitorTag = "cypher3.2"
val monitorTag = "cypher3.3"

def costBasedCompiler(config: CypherCompilerConfiguration,
clock: Clock,
Expand Down
Expand Up @@ -17,14 +17,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2
package org.neo4j.cypher.internal.compiler.v3_3

import java.util.Comparator

import org.neo4j.cypher.internal.compiler.v3_3.MinMaxOrdering._
import org.neo4j.kernel.impl.api.PropertyValueComparison

import MinMaxOrdering._

object CypherOrdering {
val DEFAULT = Ordering.comparatorToOrdering(PropertyValueComparison.COMPARE_VALUES.asInstanceOf[Comparator[Any]]).withNullsLast
}
Expand Down
Expand Up @@ -17,12 +17,12 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2
package org.neo4j.cypher.internal.compiler.v3_3

import org.neo4j.cypher.internal.compiler.v3_2.commands.values.KeyToken
import org.neo4j.cypher.internal.compiler.v3_2.helpers.{IsList, IsMap}
import org.neo4j.cypher.internal.compiler.v3_2.pipes.QueryState
import org.neo4j.cypher.internal.compiler.v3_2.spi.QueryContext
import org.neo4j.cypher.internal.compiler.v3_3.commands.values.KeyToken
import org.neo4j.cypher.internal.compiler.v3_3.helpers.{IsList, IsMap}
import org.neo4j.cypher.internal.compiler.v3_3.pipes.QueryState
import org.neo4j.cypher.internal.compiler.v3_3.spi.QueryContext
import org.neo4j.graphdb.{Node, PropertyContainer, Relationship}

import scala.collection.Map
Expand Down
Expand Up @@ -17,9 +17,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2
package org.neo4j.cypher.internal.compiler.v3_3

import org.neo4j.cypher.internal.compiler.v3_2.pipes.MutableMaps
import org.neo4j.cypher.internal.compiler.v3_3.pipes.MutableMaps

import scala.collection.mutable.{Map => MutableMap}
import scala.collection.{Iterator, immutable}
Expand Down
Expand Up @@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2
package org.neo4j.cypher.internal.compiler.v3_3

import org.neo4j.cypher.internal.frontend.v3_2.InvalidSemanticsException

Expand Down
Expand Up @@ -17,11 +17,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2
package org.neo4j.cypher.internal.compiler.v3_3

import java.io.{PrintWriter, StringWriter}

import org.neo4j.cypher.internal.compiler.v3_2.spi.QueryContext
import org.neo4j.cypher.internal.compiler.v3_3.spi.QueryContext

case class ExecutionResultDumper(result: Seq[Map[String, Any]], columns: List[String], queryStatistics: InternalQueryStatistics) extends CypherSerializer {

Expand Down
Expand Up @@ -17,15 +17,15 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2
package org.neo4j.cypher.internal.compiler.v3_3

import java.io.PrintWriter
import java.util
import java.util.Collections

import org.neo4j.cypher.internal.compiler.v3_2.executionplan.{InternalExecutionResult, InternalQueryType}
import org.neo4j.cypher.internal.compiler.v3_2.planDescription.InternalPlanDescription
import org.neo4j.cypher.internal.compiler.v3_2.spi.InternalResultVisitor
import org.neo4j.cypher.internal.compiler.v3_3.executionplan.{InternalExecutionResult, InternalQueryType}
import org.neo4j.cypher.internal.compiler.v3_3.planDescription.InternalPlanDescription
import org.neo4j.cypher.internal.compiler.v3_3.spi.InternalResultVisitor
import org.neo4j.cypher.internal.frontend.v3_2.notification.InternalNotification
import org.neo4j.graphdb.ResourceIterator

Expand Down
Expand Up @@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2
package org.neo4j.cypher.internal.compiler.v3_3

import org.neo4j.cypher.internal.frontend.v3_2.{CypherTypeException, InvalidArgumentException}

Expand Down
Expand Up @@ -17,10 +17,10 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2
package org.neo4j.cypher.internal.compiler.v3_3

import org.neo4j.cypher.internal.compiler.v3_2.spi.GraphStatistics
import org.neo4j.cypher.internal.frontend.v3_2.{LabelId, PropertyKeyId, RelTypeId}
import org.neo4j.cypher.internal.compiler.v3_3.spi.GraphStatistics
import org.neo4j.cypher.internal.frontend.v3_2.{LabelId, RelTypeId}
import org.neo4j.cypher.internal.ir.v3_2.{Cardinality, Selectivity}


Expand Down
Expand Up @@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2
package org.neo4j.cypher.internal.compiler.v3_3

trait HasOptionalDefault[T] {
def default: Option[T] = None
Expand Down
Expand Up @@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2
package org.neo4j.cypher.internal.compiler.v3_3

import org.neo4j.cypher.internal.frontend.v3_2.IdentityMap

Expand Down
Expand Up @@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2
package org.neo4j.cypher.internal.compiler.v3_3

import org.neo4j.cypher.internal.frontend.v3_2.{LabelId, PropertyKeyId}

Expand Down
Expand Up @@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2
package org.neo4j.cypher.internal.compiler.v3_3

case class InternalQueryStatistics(nodesCreated: Int = 0,
relationshipsCreated: Int = 0,
Expand Down

0 comments on commit ca81421

Please sign in to comment.