Skip to content

Commit

Permalink
GIS #462: do not push $near & $nearSphere to MongoDB
Browse files Browse the repository at this point in the history
  • Loading branch information
danylokravchenko committed Dec 12, 2023
1 parent fca97e9 commit e981474
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.polypheny.db.algebra.core.document;

import com.google.common.collect.ImmutableList;
import java.util.List;
import lombok.EqualsAndHashCode;
import lombok.Value;
Expand Down Expand Up @@ -59,6 +60,12 @@ public DocType getDocType() {
}


@Override
public List<RexNode> getChildExps() {
return ImmutableList.of( condition );
}


@Override
public AlgNode accept( RexShuttle shuttle ) {
RexNode condition = shuttle.apply( this.condition );
Expand Down
2 changes: 0 additions & 2 deletions dbms/src/test/java/org/polypheny/db/mql/FindTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,6 @@ public void geoWithinTest() {
// near

@Test
@Category( MongodbExcluded.class )
public void nearTest() {
// for mongodb: $near requires a 2dsphere index
insertMany( DATA_6 );
Expand Down Expand Up @@ -802,7 +801,6 @@ public void nearTest() {
// nearSphere

@Test
@Category( MongodbExcluded.class )
public void nearSphereTest() {
// for mongodb: $nearSphere requires a 2dsphere index
insertMany( DATA_6 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
import org.polypheny.db.algebra.core.Sort;
import org.polypheny.db.algebra.core.Values;
import org.polypheny.db.algebra.core.document.DocumentAggregate;
import org.polypheny.db.algebra.core.document.DocumentAlg.DocType;
import org.polypheny.db.algebra.core.document.DocumentFilter;
import org.polypheny.db.algebra.core.document.DocumentModify;
import org.polypheny.db.algebra.core.document.DocumentSort;
import org.polypheny.db.algebra.core.document.DocumentValues;
Expand Down Expand Up @@ -310,7 +312,8 @@ private static class MongoFilterRule extends MongoConverterRule {
private MongoFilterRule() {
super(
LogicalFilter.class,
project -> MongoConvention.mapsDocuments || !DocumentRules.containsDocument( project ),
project -> (MongoConvention.mapsDocuments || !DocumentRules.containsDocument( project ))
&& !containsIncompatible( project ),
Convention.NONE,
MongoAlg.CONVENTION,
MongoFilterRule.class.getSimpleName() );
Expand Down

0 comments on commit e981474

Please sign in to comment.