The following examples use 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;
Result:
> 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;
Result:
> "Item_ID" "Item_Name" "Item_Color" "Item_Style" "Quantity_Purchased" "Item_Price" "Total_Price"
These examples use 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;
Result:
> 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;
Result:
> "ItemName" "ItemNum" "Price" "Quantity"