Thanks @jess. i'm using version 7.7.1 .
Query1:
select * from :alias1{
?s a :Movie ;
:genre ?name
}
Query Plan 1:
From <virtual://moviesds>
Projection(?s, ?name) [#3]
`─ Slice(offset=0, limit=1000) [#3]
`─ Projection(?s, ?name) [#3]
`─ Projection(?s, ?name) [#3]
`─ ServiceJoin [#3]
+─ VirtualGraphMongoDB<virtual://moviesds> [#2] {
│ +─ RelNode=
│ +─ LogicalFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))])
│ +─ UnwoundRel(coll=[movies], unwind=[[$genre]], projection=[movieId=$_id, genre=$genre])
│ +─ Query=
│ +─ {$unwind: "$genre"},
│ +─ { $match : {$and : [ {"_id" : {$exists : true, $ne : null}}, {"genre" : {$exists : true, $ne : null}} ]} }
│ +─ Vars=
│ +─ ?s <- TEMPLATE({movieId/0})
│ +─ ?name <- COLUMN($1)^^xsd:string
│ +─ ?var100 <- COLUMN($0)^^xsd:string
│ }
`─ VirtualGraphMongoDB<virtual://moviesds> [#1] {
+─ RelNode=
+─ LogicalProject(movieId=[$0])
+─ LogicalFilter(condition=[IS NOT NULL($0)])
+─ UnwoundRel(coll=[movies], key=[[$_id]], projection=[movieId=$_id, boxOffice=$boxOffice, datePublished=$datePublished, description=$description, name=$name])
+─ Query=
+─ { $match : {"_id" : {$exists : true, $ne : null}} },
+─ {$project: {movieId: '$_id'} }
+─ Vars=
+─ ?var100 <- COLUMN($0)^^xsd:string
}
Query 2: (empty result)
select * from :alias2{
?s a :Movie ;
:genre ?name
}
Query Plan 2:
From <virtual://moviesds>
From <virtual://sqlds>
Slice(offset=0, limit=1000) [#1]
`─ Projection(?s, ?name) [#1]
`─ ServiceJoin [#1]
+─ VirtualGraphMongoDB<virtual://moviesds> [#1] {
│ +─ RelNode=
│ +─ LogicalProject(movieId=[$0])
│ +─ LogicalFilter(condition=[IS NOT NULL($0)])
│ +─ UnwoundRel(coll=[movies], key=[[$_id]], projection=[movieId=$_id, boxOffice=$boxOffice, datePublished=$datePublished, description=$description, name=$name])
│ +─ Query=
│ +─ { $match : {"_id" : {$exists : true, $ne : null}} },
│ +─ {$project: {movieId: '$_id'} }
│ +─ Vars=
│ +─ ?s <- TEMPLATE({movieId/0})
│ }
`─ VirtualGraphMongoDB<virtual://moviesds> [#2] {
+─ RelNode=
+─ LogicalFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))])
+─ UnwoundRel(coll=[movies], unwind=[[$genre]], projection=[movieId=$_id, genre=$genre])
+─ Query=
+─ {$unwind: "$genre"},
+─ { $match : {$and : [ {"_id" : {$exists : true, $ne : null}}, {"genre" : {$exists : true, $ne : null}} ]} }
+─ Vars=
+─ ?s <- TEMPLATE({movieId/0})
+─ ?name <- COLUMN($1)^^xsd:string
}
Any help would be greatful