Example: Using DATASET_KEYS - Teradata Vantage NewSQL Engine - 16.20

Teradata Vantageā„¢ DATASET Data Type

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

The following example uses DATASET_KEYS on Avro data already stored in a table.

/*simple key extraction*/
SELECT * FROM DATASET_KEYS
(
	ON (SELECT avroFile FROM myAVROTable09)
) AS avroKeys ORDER BY 1;
> Item_ID
  Item_Name
  Item_Color
  Item_Style
  Quantity_Purchased
  Item_Price
  Total_Price

/*display the keys wrapped in double quotes*/
SEL * FROM DATASET_KEYS
(
	ON (SELECT avroFile FROM myAVROTable09)
	USING QUOTES(Y)
) AS avroKeys ORDER BY 1;
> "Item_ID"
  "Item_Name"
  "Item_Color"
  "Item_Style"
  "Quantity_Purchased"
  "Item_Price"
  "Total_Price"

This example uses DATASET_KEYS on CSV data already stored in a table.

/*simple key extraction*/
SELECT * FROM DATASET_KEYS
(
 ON (SELECT csvFile FROM myCSVTable09)
) AS csvKeys ORDER BY 1;
>  ItemName
   ItemNum
   Price
   Quantity
 
/*display the keys wrapped in double quotes*/

SELECT * FROM DATASET_KEYS
(
 ON (SELECT csvFile FROM myCSVTable09)
 USING QUOTES('Y')
) AS csvKeys ORDER BY 1;
>  "ItemName"
   "ItemNum"
   "Price"
   "Quantity"