forked from neo4j/neo4j
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow SET += / = Syntax on variables with no semantic information
SET x += {prop: 5} would previously fail if x had no semantic information, even if it turned out to be a node/relationship at runtime. This is now fixed. This also fixes a tangential problem with invalidation of cached properties in +=. This also fixes a tangential problem with eagerization of SET for different cases.
- Loading branch information
Showing
12 changed files
with
241 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
....5/src/main/scala/org/neo4j/cypher/internal/v3_5/logical/plans/SetPropertiesFromMap.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright (c) 2002-2019 "Neo4j," | ||
* Neo4j Sweden AB [http://neo4j.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 <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.neo4j.cypher.internal.v3_5.logical.plans | ||
|
||
import org.neo4j.cypher.internal.ir.v3_5.StrictnessMode | ||
import org.neo4j.cypher.internal.v3_5.expressions.Expression | ||
import org.neo4j.cypher.internal.v3_5.util.attribution.IdGen | ||
|
||
/** | ||
* for ( row <- source ) | ||
* thing = row.get(idName) | ||
* for ( (key,value) <- row.evaluate( expression ) ) | ||
* thing.setProperty( key, value ) | ||
* | ||
* produce row | ||
*/ | ||
case class SetPropertiesFromMap(source: LogicalPlan, | ||
entity: Expression, | ||
expression: Expression, | ||
removeOtherProps: Boolean | ||
)(implicit idGen: IdGen) extends LogicalPlan(idGen) { | ||
|
||
override def lhs: Option[LogicalPlan] = Some(source) | ||
|
||
override val availableSymbols: Set[String] = source.availableSymbols | ||
|
||
override def rhs: Option[LogicalPlan] = None | ||
|
||
override def strictness: StrictnessMode = source.strictness | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.