Select Columns

Select Columns

Available since 15.1 Southside release

  • Facilitates easier selection and management of columns through more concise syntax.

  • This method is used to specify all the columns of the current pipelines.

Code

def qapi = api.queryApi() def productTable = qapi.tables().products() def sku = productTable.sku() def label = productTable.label() return qapi.source(productTable, [sku, label]) .selectColumns({ prev -> [prev.sku, prev.sku.concat(prev.label).as("skuLabel")] }) .take(10) .stream { return it.collect { it } }

Result

sku

skuLabel

sku

skuLabel

B-0029

B-0029 1st Amendment IPA (2006)

B-0028

B-0028 1st Amendment Watermelon Wheat Beer (2006)

B-0072

B-0072 5 K

B-0073

B-0073 A Beer

B-0067

B-0067 Abita Amber

B-0100

B-0100 Added by DCR

AK_0001

AK_0001 AK_0001 PFSFDCQC-4945

AK_0002

AK_0002 AK_0002 PFSFDCQC-5154

AK_0003

AK_0003 AK-0003 PFSFDCQC-4985

AK_0004

AK_0004 AK_0004 PFUN-3709

See Also

Found an issue in documentation? Write to us.