Simple Query Data Feed

Simple Query Data Feed

  • Simple Query against Data Feed.

  • Provides table from .tables() in .dataFeed().

Code

def qapi = api.queryApi() def exprs = qapi.exprs() def t1 = qapi.tables().dataFeed("Gapminder") return qapi.source(t1, [t1.attribute1.as("Country"), t1.attribute5.as("Fertility"), t1.attribute7.as("Population"), t1.attribute3.as("Year")], exprs.and( t1.attribute3.equal("1950") ) ) .stream { it.collect { it } }

Result

Country

Fertility

Population

Year

Country

Fertility

Population

Year

Afghanistan

8

8,151,455

1950

Albania

5.8

1,215,002

1950

Algeria

7.6

8,752,997

1950

Afghanistan

8

8,151,455

1950

Albania

5.8

1,215,002

1950

Algeria

7.6

8,752,997

1950

Angola

6.9

4,147,509

1950

Antigua and Barbuda

4.4

46,301

1950

Argentina

3.2

17,150,335

1950

Armenia

4.5

1,353,506

1950

See Also

Found an issue in documentation? Write to us.