HazyResearch / ddlog

Compiler for writing DeepDive applications in a Datalog-like language — ⚠️🚧🛑 REPO MOVED TO DEEPDIVE 👇🏿
https://github.com/HazyResearch/deepdive/tree/master/compiler/ddlog
19 stars 4 forks source link

syntax: union query (and not only union all) #67

Open ThomasPalomares opened 8 years ago

ThomasPalomares commented 8 years ago

It seems that only "union all" can be made currently in ddlog. For instance, the queries table(...) :- table1(...); table2(...). and the query table(...) :- table1(...). table(...) *:- table2(...). are both compiled into "INSERT INTO table SELECT DISTINCT ... from table1 UNION ALL SELECT DISTINCT ... from table2;" and not into an union.

It would be useful to have a way to write an "union" an not only "union all" (though it can certainly be tricky to implement when there are multiple rules for the same head but only some of them are using *:-)