Example: Aggregating Avro Output - Analytics Database - Teradata Vantage

DATASET Data Type

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2023-10-30
dita:mapPath
bka1628112240653.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
ekk1458586304878
lifecycle
latest
Product Category
Teradata Vantageā„¢

Output may be aggregated into one JSON array composed of JSON objects mapping to the CSV data.

SELECT * FROM CSV_TO_JSON
(
	ON (SELECT csvFile FROM myCSVTable09 WHERE id=2)
	USING SCHEMA('{"record_delimiter":"#"}') DO_AGGREGATE('Y')
) AS csvJSON;

Result:

> [{"Item_ID":"55", "Item_Name":"bicycle", "Item_Color":"red", "Item_Style":"boys", "Quantity_Purchased":"1", "Item_Price":"100.00", "Total_Price":"100.00"}, {"Item_ID":"88", "Item_Name":"toy boat", "Item_Color":"pink", "Item_Style":null, "Quantity_Purchased":"1", "Item_Price":"15.10", "Total_Price":"15.10"}, {"Item_ID":"105", "Item_Name":"soap", "Item_Color":null, "Item_Style":null, "Quantity_Purchased":"1", "Item_Price":"0.99", "Total_Price":"0.99"}]