queries on queries in VIATRA [message #1752926] |
Mon, 30 January 2017 15:57  |
Eclipse User |
|
|
|
Hi,
I am creating a DSL in xtext which can compile to sql queries which use as a source 'table' the results of other SQL queries defined in the DSL (i.e 'views on views' of a source table/dataset). My current target platform is apache spark and spark SQL, but that can change. I would like this to work in an incramental way so that when the source data (e.g. source tables) are updated, the resulting queries (and queries upon those query results) are recalculated in the most efficient way possible . Since VIATRA offers efficient incremental queries (using viatra query language) I was wondering if it is possible to to define viatra queries with the source of those queries being the result of another VIATRA query.
I realise this is a pretty big and complex topic, and its hard to describe my use case concisely, but if anyone has any quick pointers to previous work or advice then any hints at all would be very welcome.
Thanks,
Neil
|
|
|
Re: queries on queries in VIATRA [message #1752948 is a reply to message #1752926] |
Tue, 31 January 2017 03:19   |
Eclipse User |
|
|
|
Hi Neil,
I hope I have understood your question correctly. If not, or the answer is not clear, feel free to ask for clarification.
If you are asking for how the language supports queries whose result set depends on other queries result sets, the query language provides support for that, similar to subqueries in SQL: you can write a pattern that describes the subquery, and then you can use the three kinds of 'find' constructs for composing the final result:: (1) positive pattern call constraints ('find'), (2) negative pattern call constraints ('neg find') and (3) aggregator values (such as 'count find' or 'sum find'). All these language elements take the match set of another pattern, and allow to write additional constraints to extend or limit the result set accordingly. Alternatively, you can think of this approach as a query defining a named database view that you can refer to from other queries. In such cases, the incremental engine of VIATRA manages the propagation of changes between the different patterns automatically.
Hope that helps,
Zoltán
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05310 seconds