Skip to content

Commit

Permalink
minor change at prefix for query
Browse files Browse the repository at this point in the history
  • Loading branch information
NehaSelvan1512 committed Sep 15, 2023
1 parent 1ef13a8 commit ce068fc
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,18 @@
import org.bson.BsonDocument;
import org.bson.BsonDouble;
import org.bson.BsonString;
import org.polypheny.db.PolyImplementation;
import org.polypheny.db.algebra.AlgNode;
import org.polypheny.db.algebra.AlgRoot;
import org.polypheny.db.algebra.logical.document.LogicalDocumentValues;
import org.polypheny.db.languages.QueryLanguage;
import org.polypheny.db.languages.mql.MqlFind;
import org.polypheny.db.languages.mql2alg.MqlToAlgConverter;
import org.polypheny.db.plan.AlgOptCluster;
import org.polypheny.db.prepare.Context;
import org.polypheny.db.prepare.PolyphenyDbCatalogReader;
import org.polypheny.db.processing.Processor;
import org.polypheny.db.stream.StreamProcessorImpl;
import org.polypheny.db.tools.AlgBuilder;
import org.polypheny.db.transaction.Statement;
import org.polypheny.db.transaction.TransactionException;

@Slf4j
public class MqttStreamProcessor extends StreamProcessorImpl {
Expand All @@ -56,7 +53,7 @@ public MqttStreamProcessor( MqttMessage mqttMessage, String filterQuery, Stateme
//TODO: in Tutorial schreiben, was allgemein für Strings gilt
public boolean applyFilter() {
AlgRoot root = processMqlQuery();
List<List<Object>> res = executeAndTransformPolyAlg( root, statement);
List<List<Object>> res = executeAndTransformPolyAlg( root, statement );
log.info( res.toString() );
return res.size() != 0;
}
Expand All @@ -69,7 +66,7 @@ private AlgRoot processMqlQuery() {
final AlgOptCluster cluster = AlgOptCluster.createDocument( statement.getQueryProcessor().getPlanner(), algBuilder.getRexBuilder() );
MqlToAlgConverter mqlConverter = new MqlToAlgConverter( mqlProcessor, catalogReader, cluster );

MqlFind find = (MqlFind) mqlProcessor.parse( String.format( "db.%s.find(%s)", "null", this.filterQuery ) ).get( 0 );
MqlFind find = (MqlFind) mqlProcessor.parse( String.format( "db.%s.find(%s)", "collection", this.filterQuery ) ).get( 0 );
String msg = getStream();
BsonDocument msgDoc;
AlgNode input;
Expand All @@ -92,4 +89,5 @@ private AlgRoot processMqlQuery() {
input = LogicalDocumentValues.create( cluster, ImmutableList.of( msgDoc ) );
return mqlConverter.convert( find, input );
}

}

0 comments on commit ce068fc

Please sign in to comment.