Example: Using the SCHEMA Custom Clause to Specify Non-Standard Data

Teradata Vantageā„¢ DATASET Data Type

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1198-162K

If there is non-standard CSV data, use the SCHEMA custom clause to specify non-standard data.

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

{"Item_ID":"105","Item_Name":"soap","Item_Color":null,"Item_Style":null,"Quantity_Purchased":"1","Item_Price":"0.99","Total_Price":"0.99"}
{"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"}