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 20e2287697ab..23b7ee915649 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 @@ -32,7 +32,7 @@ case class DirectedRelationshipByIdSeekPipe(ident: String, relIdExpr: SeekArgs, protected def internalCreateResults(state: QueryState): Iterator[ExecutionContext] = { val ctx = state.newExecutionContext(executionContextFactory) - val relIds = VirtualValues.dropNoValues(relIdExpr.expressions(ctx, state)) + val relIds = relIdExpr.expressions(ctx, state).dropNoValues() new DirectedRelationshipIdSeekIterator( ident, fromNode, 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 277e58bf29f9..27bd928ac4fd 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 @@ -32,7 +32,7 @@ case class UndirectedRelationshipByIdSeekPipe(ident: String, relIdExpr: SeekArgs protected override def internalCreateResults(state: QueryState): Iterator[ExecutionContext] = { val ctx = state.createOrGetInitialContext(executionContextFactory) - val relIds = VirtualValues.dropNoValues(relIdExpr.expressions(ctx, state)) + val relIds = relIdExpr.expressions(ctx, state).dropNoValues() new UndirectedRelationshipIdSeekIterator( ident, fromNode, diff --git a/community/values/src/main/java/org/neo4j/values/virtual/ListValue.java b/community/values/src/main/java/org/neo4j/values/virtual/ListValue.java index bd7dab530177..3a1bb2ed48c6 100644 --- a/community/values/src/main/java/org/neo4j/values/virtual/ListValue.java +++ b/community/values/src/main/java/org/neo4j/values/virtual/ListValue.java @@ -891,4 +891,9 @@ public int length() { return size(); } + + public ListValue dropNoValues() + { + return new DropNoValuesListValue( this ); + } } diff --git a/community/values/src/main/java/org/neo4j/values/virtual/VirtualValues.java b/community/values/src/main/java/org/neo4j/values/virtual/VirtualValues.java index dcdbd3cecab9..454038ac2ffa 100644 --- a/community/values/src/main/java/org/neo4j/values/virtual/VirtualValues.java +++ b/community/values/src/main/java/org/neo4j/values/virtual/VirtualValues.java @@ -63,11 +63,6 @@ public static ListValue fromArray( ArrayValue arrayValue ) return new ListValue.ArrayValueListValue( arrayValue ); } - public static ListValue dropNoValues( ListValue list ) - { - return new ListValue.DropNoValuesListValue( list ); - } - public static ListValue slice( ListValue list, int from, int to ) { int f = Math.max( from, 0 ); diff --git a/community/values/src/test/java/org/neo4j/values/virtual/DropNoValuesListValueTest.java b/community/values/src/test/java/org/neo4j/values/virtual/DropNoValuesListValueTest.java index 602eae077028..a37fd720d627 100644 --- a/community/values/src/test/java/org/neo4j/values/virtual/DropNoValuesListValueTest.java +++ b/community/values/src/test/java/org/neo4j/values/virtual/DropNoValuesListValueTest.java @@ -25,7 +25,6 @@ import static org.junit.Assert.assertEquals; import static org.neo4j.values.storable.Values.NO_VALUE; import static org.neo4j.values.storable.Values.longValue; -import static org.neo4j.values.virtual.VirtualValues.dropNoValues; import static org.neo4j.values.virtual.VirtualValues.list; public class DropNoValuesListValueTest @@ -38,7 +37,7 @@ public void shouldFilterList() longValue( 8L ), longValue( 9L ), longValue( 11L ), NO_VALUE ); // When - ListValue filter = dropNoValues( inner ); + ListValue filter = inner.dropNoValues(); // Then ListValue expected = list( longValue( 6L ), longValue( 8L ), longValue( 9L ), longValue( 11L ) ); diff --git a/community/values/src/test/java/org/neo4j/values/virtual/ListTest.java b/community/values/src/test/java/org/neo4j/values/virtual/ListTest.java index 5b7cf0eeb060..5d63b36c3cfa 100644 --- a/community/values/src/test/java/org/neo4j/values/virtual/ListTest.java +++ b/community/values/src/test/java/org/neo4j/values/virtual/ListTest.java @@ -219,12 +219,12 @@ public void shouldRecurseAndCoerce() range( 1L, 8L, 3L ), VirtualValues.fromArray( Values.longArray( new long[]{1L, 4L, 7L} ) ), - VirtualValues.dropNoValues( VirtualValues.list( NO_VALUE, - longValue( 1L ), - NO_VALUE, - longValue( 4L ), - longValue( 7L ), - NO_VALUE ) ), + VirtualValues.list( NO_VALUE, + longValue( 1L ), + NO_VALUE, + longValue( 4L ), + longValue( 7L ), + NO_VALUE ).dropNoValues(), VirtualValues.slice( list( -2L, 1L, 4L, 7L, 10L ), 1, 4 ), VirtualValues.drop( list( -2L, 1L, 4L, 7L ), 1 ), VirtualValues.take( list( 1L, 4L, 7L, 10L, 13L ), 3 ), @@ -237,12 +237,12 @@ public void shouldRecurseAndCoerce() range( 2L, 9L, 3L ), VirtualValues.fromArray( Values.longArray( new long[]{3L, 6L, 9L} ) ), - VirtualValues.dropNoValues( VirtualValues.list( NO_VALUE, - longValue( 1L ), - NO_VALUE, - longValue( 5L ), - longValue( 7L ), - NO_VALUE ) ), + VirtualValues.list( NO_VALUE, + longValue( 1L ), + NO_VALUE, + longValue( 5L ), + longValue( 7L ), + NO_VALUE ).dropNoValues(), VirtualValues.slice( list( -2L, 1L, 5L, 8L, 11L ), 1, 4 ), VirtualValues.drop( list( -2L, 6L, 9L, 12L ), 1 ), VirtualValues.take( list( 7L, 10L, 13L, 10L, 13L ), 3 ),