-
Simple Query against Data Source.
-
Provides table from
.tables()in.dataSource().
Code
Groovy
def qapi = api.queryApi()
def exprs = qapi.exprs()
def t1 = qapi.tables().dataSource("Gapminder")
return qapi.source(t1, [t1.Country, t1.Population, t1.Year],
exprs.and(
t1.Country.equal("Canada")
)
)
.stream { it.collect { it } }
Result
|
Country |
Population |
Year |
|---|---|---|
|
Canada |
33,327,954 |
2008 |
|
Canada |
33,675,448 |
2009 |
|
Canada |
34,016,593 |
2010 |
|
Canada |
34,349,561 |
2011 |
|
Canada |
34,674,708 |
2012 |
|
Canada |
34,993,747 |
2013 |