use of org.apache.rya.accumulo.pig.optimizer.SimilarVarJoinOptimizer in project incubator-rya by apache.
the class SparqlToPigTransformVisitorTest method testCross.
public void testCross() throws Exception {
String query = "select * where {\n" + "?subj0 <urn:lubm:rdfts#name> 'Department0'.\n" + "?subj1 <urn:lubm:rdfts#name> 'Department1'.\n" + "?subj0 <urn:lubm:rdfts#subOrganizationOf> <http://www.University0.edu>.\n" + "?subj1 <urn:lubm:rdfts#subOrganizationOf> <http://www.University0.edu>.\n" + "}";
// System.out.println(query);
QueryParser parser = new SPARQLParser();
ParsedQuery parsedQuery = parser.parseQuery(query, null);
QueryRoot tupleExpr = new QueryRoot(parsedQuery.getTupleExpr());
SimilarVarJoinOptimizer similarVarJoinOptimizer = new SimilarVarJoinOptimizer();
similarVarJoinOptimizer.optimize(tupleExpr, null, null);
// System.out.println(tupleExpr);
SparqlToPigTransformVisitor visitor = new SparqlToPigTransformVisitor();
visitor.setTablePrefix(tablePrefix);
visitor.setInstance(instance);
visitor.setZk(zk);
visitor.setUser(user);
visitor.setPassword(password);
visitor.meet(tupleExpr);
// System.out.println(visitor.getPigScript());
}
Aggregations