17.10 - 例: Avro出力の集約 - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - DATASETデータ型

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
2021年7月
Content Type
プログラミング リファレンス
Publication ID
B035-1198-171K-JPN
Language
日本語 (日本)

CSVデータの各レコードへのAvroレコード マッピングで構成されるAvro配列の1つに出力を集約します。

SELECT data.toJSON() FROM CSV_TO_AVRO
 (
	ON (SELECT csvFile FROM myCSVTable09 WHERE id=2)
	USING SCHEMA('{"record_delimiter":"#"}')DO_AGGREGATE('Y')
) AS csvAvro;

> [{"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"}]