[Swift-commit] r4984 - provenancedb

lgadelha at ci.uchicago.edu lgadelha at ci.uchicago.edu
Thu Aug 11 12:32:43 CDT 2011


Author: lgadelha
Date: 2011-08-11 12:32:43 -0500 (Thu, 11 Aug 2011)
New Revision: 4984

Modified:
   provenancedb/ProvSQL.g
Log:
Minor updates.


Modified: provenancedb/ProvSQL.g
===================================================================
--- provenancedb/ProvSQL.g	2011-08-11 17:21:19 UTC (rev 4983)
+++ provenancedb/ProvSQL.g	2011-08-11 17:32:43 UTC (rev 4984)
@@ -137,8 +137,8 @@
 		joinExpressions.put(schemaGraph.getEdge("proc", "app_inv"), "proc.id=app_inv.id");
 		joinExpressions.put(schemaGraph.getEdge("app_inv", "app_exec"), "app_inv.id=app_exec.app_inv_id");
 		joinExpressions.put(schemaGraph.getEdge("app_exec", "rt_info"), "app_exec.id=rt_info.app_exec_id");
-		joinExpressions.put(schemaGraph.getEdge("ds", "ds_in"), "ds.id=ds_in.id");
-		joinExpressions.put(schemaGraph.getEdge("ds", "ds_out"), "ds.id=ds_out.id");
+		joinExpressions.put(schemaGraph.getEdge("ds", "ds_in"), "ds.id=ds_in.ds_id");
+		joinExpressions.put(schemaGraph.getEdge("ds", "ds_out"), "ds.id=ds_out.ds_id");
 		joinExpressions.put(schemaGraph.getEdge("ds", "a_ds_t"), "ds.id=a_ds_t.ds_id");
 		joinExpressions.put(schemaGraph.getEdge("ds", "a_ds_n"), "ds.id=a_ds_n.ds_id");
 		joinExpressions.put(schemaGraph.getEdge("ds", "file"), "ds.id=file.id");
@@ -187,7 +187,26 @@
 	
 }
 
-query	:	SELECT selectExpression 
+query	:	squery ( 
+		( 
+		UNION { System.out.println(" UNION "); }
+		| 
+		INTERSECT { System.out.println(" INTERSECT "); }
+		| 
+		EXCEPT { System.out.println(" EXCEPT "); }
+		) 
+		(
+		ALL { System.out.println(" ALL "); }
+		)? 
+		squery 
+		)* 		
+		SEMICOLON 
+		{
+			System.out.print(";");
+		}
+;
+
+squery	:	SELECT selectExpression 
 		{ 
 			schemaGraph = buildGraph();
 			joinEdges = computeJoinEdges(schemaGraph, relations);
@@ -209,16 +228,12 @@
 		(WHERE whereExpression
 		{
 			if(hasWhereJoinExpression)
-				System.out.print(",");
+				System.out.print(" AND ");
 			else
 				System.out.print(" WHERE ");
 			System.out.print(whereClause);
 		}
 		)? 
-		SEMICOLON 
-		{
-			System.out.print(";");
-		}
 		;     
 
 selectExpression
@@ -276,6 +291,15 @@
 
 OR	:	'o' 'r';
 
+UNION	:	'u' 'n' 'i' 'o' 'n';
+
+INTERSECT 
+	:	'i' 'n' 't' 'e' 'r' 's' 'e' 'c' 't';
+
+EXCEPT	:	'e' 'x' 'c' 'e' 'p' 't';
+
+ALL	:	'a' 'l' 'l';
+
 DOT	:	'.';
 
 COLON	:	',';




More information about the Swift-commit mailing list