# HG changeset patch # User František Kučera # Date 1549558505 -3600 # Node ID ce8a4be9563256d36df6ba88b144c13171321edc # Parent e76ca9f7d6cb983b57fbb2773fee660579ceb942 examples: Processing multiple relations with Guile diff -r e76ca9f7d6cb -r ce8a4be95632 relpipe-data/examples-guile-aggregations.xml --- a/relpipe-data/examples-guile-aggregations.xml Thu Feb 07 16:24:21 2019 +0100 +++ b/relpipe-data/examples-guile-aggregations.xml Thu Feb 07 17:55:05 2019 +0100 @@ -34,7 +34,7 @@ Record count: 1]]>

- In SQL same result can be achieved by: + In SQL, the same result can be achieved by:

+ + Processing multiple relations with Guile + filter some relations and others keep unaffected + 01800 + + + +

+ The relpipe-tr-guile is capable to process multiple relations in a single pass. + So we can filter some relations and let others flow unaffected through this pipeline step. +

+ + $size 8000) (< $size 9000) )' \ + | relpipe-out-tabular]]> + +

Such script will generate something like this:

+ + + + +

+ In Guile, we have filtered the fstab and filesystem relations + while the seq relation was kept intact. +

+ +

+ The --relation option accepts a regular expression. + So it is possible to process more than one relation with it (having all needed attributes in each, of course). + If more --relation options (e.g. 'f.*' and fstab) matches the same relation in the stream, only the first wins and transforms that relation. +

+ +

+ If we define some variables in the Guile context, they will stay there – so we can pass data across relations. + Thus we can do even JOIN, if we really want. +

+ + +
+ +